[BACK]Return to misc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ranlib

Diff for /src/usr.bin/ranlib/Attic/misc.c between version 1.4 and 1.5

version 1.4, 1999/08/27 08:43:22 version 1.5, 1999/09/21 13:15:43
Line 49 
Line 49 
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include "pathnames.h"  #include "pathnames.h"
   #include "extern.h"
   
 extern char     *archive;                       /* archive name */  char *tname = "temporary file";
 char            *tname = "temporary file";  
   
   int
 tmp()  tmp()
 {  {
         static char *envtmp;          static char *envtmp;
Line 80 
Line 81 
         (void)sigprocmask(SIG_BLOCK, &set, &oset);          (void)sigprocmask(SIG_BLOCK, &set, &oset);
         if ((fd = mkstemp(path)) == -1)          if ((fd = mkstemp(path)) == -1)
                 error(tname);                  error(tname);
         (void)unlink(path);          (void)unlink(path);
         (void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);          (void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);
         return(fd);          return(fd);
 }  }
   
 void *  void *
 emalloc(len)  emalloc(len)
         int len;          size_t len;
 {  {
         char *p;          void *p;
   
         if (!(p = malloc((u_int)len)))          if (!(p = malloc(len)))
                 error(archive);                  error(archive);
         return(p);          return(p);
 }  }
   
 char *  const char *
 rname(path)  rname(path)
         char *path;          const char *path;
 {  {
         register char *ind;          register const char *ind;
   
         return((ind = strrchr(path, '/')) ? ind + 1 : path);          return((ind = strrchr(path, '/')) ? ind + 1 : path);
 }  }
   
   void
 badfmt()  badfmt()
 {  {
         errno = EFTYPE;          errno = EFTYPE;
         error(archive);          error(archive);
 }  }
   
   void
 error(name)  error(name)
         char *name;          const char *name;
 {  {
         (void)fprintf(stderr, "ranlib: %s: %s\n", name, strerror(errno));  
         exit(1);          err(1, "%s", name);
 }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5