source: scripts/patches/ed-0.2-mkstemp-1.patch @ d7f7ff5

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since d7f7ff5 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 18 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100644
File size: 738 bytes
  • buf.c

    Submitted By: LFS Book <lfs-book@linuxfromscratch.org>
    Date: 2003-10-05
    Initial Package Version: 0.2
    Origin: Slackware Source
    Description: Use mkstemp instead of mktemp.
    diff -Naur ed-0.2/buf.c ed-0.2-2/buf.c
    old new  
    200200int
    201201open_sbuf ()
    202202{
    203   char *mktemp ();
    204   int u;
     203  int u, sfd;
    205204
    206205  isbinary = newline_added = 0;
    207206  u = umask(077);
    208207  strcpy (sfn, "/tmp/ed.XXXXXX");
    209   if (mktemp (sfn) == NULL || (sfp = fopen (sfn, "w+")) == NULL)
     208  sfd = mkstemp(sfn);
     209    if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)
    210210    {
    211211      fprintf (stderr, "%s: %s\n", sfn, strerror (errno));
    212212      sprintf (errmsg, "Cannot open temp file");
Note: See TracBrowser for help on using the repository browser.