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

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 073fae8 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 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.