source: patches/ed-0.2-mkstemp-1.patch@ 873009c

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 873009c was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • 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.