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

Diff for /src/usr.bin/dc/dc.c between version 1.14 and 1.15

version 1.14, 2015/10/03 18:39:13 version 1.15, 2015/10/09 01:37:07
Line 47 
Line 47 
         char            *buf, *p;          char            *buf, *p;
         struct stat     st;          struct stat     st;
   
         if (tame("stdio rpath", NULL) == -1)          if (pledge("stdio rpath", NULL) == -1)
                 err(1, "tame");                  err(1, "pledge");
   
         if ((buf = strdup("")) == NULL)          if ((buf = strdup("")) == NULL)
                 err(1, NULL);                  err(1, NULL);
Line 91 
Line 91 
                 file = fopen(argv[0], "r");                  file = fopen(argv[0], "r");
                 if (file == NULL)                  if (file == NULL)
                         err(1, "cannot open file %s", argv[0]);                          err(1, "cannot open file %s", argv[0]);
                 if (tame("stdio", NULL) == -1)                  if (pledge("stdio", NULL) == -1)
                         err(1, "tame");                          err(1, "pledge");
                 if (fstat(fileno(file), &st) == -1)                  if (fstat(fileno(file), &st) == -1)
                         err(1, "%s", argv[0]);                          err(1, "%s", argv[0]);
                 if (S_ISDIR(st.st_mode))                  if (S_ISDIR(st.st_mode))
Line 107 
Line 107 
                  */                   */
                  return (0);                   return (0);
         }          }
         if (tame("stdio", NULL) == -1)          if (pledge("stdio", NULL) == -1)
                 err(1, "tame");                  err(1, "pledge");
         src_setstream(&src, stdin);          src_setstream(&src, stdin);
         reset_bmachine(&src);          reset_bmachine(&src);
         eval();          eval();

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15