/[mailutils]/mailutils/mh/mh_init.c
ViewVC logotype

Diff of /mailutils/mh/mh_init.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by polak, Sun Mar 16 12:18:59 2003 UTC revision 1.37 by gray, Tue Mar 18 23:15:54 2003 UTC
# Line 21  Line 21 
21  #include <pwd.h>  #include <pwd.h>
22  #include <sys/types.h>  #include <sys/types.h>
23  #include <sys/stat.h>  #include <sys/stat.h>
24    #include <sys/time.h>
25  #include <stdarg.h>  #include <stdarg.h>
26  #include <unistd.h>  #include <unistd.h>
27  #include <errno.h>  #include <errno.h>
# Line 733  mh_draft_name () Line 734  mh_draft_name ()
734    return mh_expand_name (draftfolder, "draft", 0);    return mh_expand_name (draftfolder, "draft", 0);
735  }  }
736    
737    char *
738    mh_create_message_id (int m)
739    {
740      char date[4+2+2+2+2+2+1];
741      time_t t = time (NULL);
742      struct tm *tm = localtime (&t);
743      char *host;
744      char *p;
745              
746      strftime (date, sizeof date, "%Y%m%d%H%M%S", tm);
747      mu_get_host_name (&host);
748    
749      if (m)
750        {
751          struct timeval tv;
752          gettimeofday (&tv, NULL);
753          asprintf (&p, "<%s.%lu.%lu@%s>",
754                    date,
755                    (unsigned long) tv.tv_usec,
756                    (unsigned long) getpid (),
757                    host);
758        }
759      else
760        asprintf (&p, "<%s.%lu@%s>", date, (unsigned long) getpid (), host);
761      free (host);
762      return p;
763    }

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26