/[mailutils]/mailutils/mailbox/mutil.c
ViewVC logotype

Diff of /mailutils/mailbox/mutil.c

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

revision 1.38 by gray, Fri Aug 23 06:53:02 2002 UTC revision 1.39 by gray, Sun Sep 1 22:04:38 2002 UTC
# Line 692  mu_normalize_maildir (const char *dir) Line 692  mu_normalize_maildir (const char *dir)
692      }      }
693  }  }
694    
695  /* Create and open a temporary file. Be vary careful about it, since we  /* Create and open a temporary file. Be very careful about it, since we
696     may be running with extra privilege i.e setgid().     may be running with extra privilege i.e setgid().
697     Returns file descriptor of the open file.     Returns file descriptor of the open file.
698     If namep is not NULL, the pointer to the malloced file name will     If namep is not NULL, the pointer to the malloced file name will
# Line 748  mu_tempfile (const char *tmpdir, char ** Line 748  mu_tempfile (const char *tmpdir, char **
748    return fd;    return fd;
749  }  }
750    
751    /* Create a unique temporary file name in tmpdir. The function
752       creates an empty file with this name to avoid possible race
753       conditions. Returns a pointer to the malloc'ed file name.
754       If tmpdir is NULL, the value of the environment variable
755       TMPDIR or the hardcoded P_tmpdir is used, whichever is defined. */
756    
757    char *
758    mu_tempname (const char *tmpdir)
759    {
760      char *filename = NULL;
761      int fd = mu_tempfile (tmpdir, &filename);
762      close (fd);
763      return filename;
764    }
765    
766  /* See Advanced Programming in the UNIX Environment, Stevens,  /* See Advanced Programming in the UNIX Environment, Stevens,
767   * program  10.20 for the rational for the signal handling. I   * program  10.20 for the rational for the signal handling. I
768   * had to look it up, so if somebody else is curious, thats where   * had to look it up, so if somebody else is curious, thats where

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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