pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/40548: mail/mutt-devel crash after 64bit time_t branch is merged.



The following reply was made to PR pkg/40548; it has been noted by GNATS.

From: NONAKA Kimihiro <nonakap%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: pkg/40548: mail/mutt-devel crash after 64bit time_t branch is 
        merged.
Date: Wed, 4 Feb 2009 02:51:17 +0900

 2009/2/4 Christos Zoulas <christos%zoulas.com@localhost>:
 
 >  | >Fix:
 >  | --- mh.c.orig 2009-02-03 21:54:23.000000000 +0900
 >  | +++ mh.c        2009-02-03 21:54:58.000000000 +0900
 >  | @@ -1242,7 +1242,7 @@
 >  |    omask = umask (mh_umask (dest));
 >  |    FOREVER
 >  |    {
 >  | -    snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
 >  | +    snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%lld.%u_%d.%s%s",
 >  |               dest->path, subdir, time (NULL), (unsigned int)getpid (),
 >  |               Counter++, NONULL (Hostname), suffix);
 >  |
 >  | @@ -1328,7 +1328,7 @@
 >  |    /* construct a new file name. */
 >  |    FOREVER
 >  |    {
 >  | -    snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
 >  | +    snprintf (path, _POSIX_PATH_MAX, "%s/%lld.%u_%d.%s%s", subdir,
 >  |               time (NULL), (unsigned int)getpid (), Counter++,
 >  |               NONULL (Hostname), suffix);
 >  |      snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
 >
 >  You need casts to long long in the return of time, so that it works on
 >  all the platforms.
 
 Indeed, It is so.
 
 --- mh.c.orig   2009-01-06 04:20:53.000000000 +0900
 +++ mh.c        2009-02-04 02:49:52.000000000 +0900
 @@ -1242,8 +1242,8 @@
    omask = umask (mh_umask (dest));
    FOREVER
    {
 -    snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%ld.%u_%d.%s%s",
 -             dest->path, subdir, time (NULL), (unsigned int)getpid (),
 +    snprintf (path, _POSIX_PATH_MAX, "%s/tmp/%s.%lld.%u_%d.%s%s",
 +             dest->path, subdir, (long long)time (NULL), (unsigned
 int)getpid (),
               Counter++, NONULL (Hostname), suffix);
 
      dprint (2, (debugfile, "maildir_open_new_message (): Trying %s.\n",
 @@ -1328,8 +1328,8 @@
    /* construct a new file name. */
    FOREVER
    {
 -    snprintf (path, _POSIX_PATH_MAX, "%s/%ld.%u_%d.%s%s", subdir,
 -             time (NULL), (unsigned int)getpid (), Counter++,
 +    snprintf (path, _POSIX_PATH_MAX, "%s/%lld.%u_%d.%s%s", subdir,
 +             (long long)time (NULL), (unsigned int)getpid (), Counter++,
               NONULL (Hostname), suffix);
      snprintf (full, _POSIX_PATH_MAX, "%s/%s", ctx->path, path);
 
 regards,
 -- 
 NONAKA Kimihiro
 


Home | Main Index | Thread Index | Old Index