Print this page
6017 savecore's messages about read errors are useless

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/savecore/savecore.c
          +++ new/usr/src/cmd/savecore/savecore.c
↓ open down ↓ 258 lines elided ↑ open up ↑
 259  259          if ((fd = open64(name, oflags, mode)) == -1)
 260  260                  logprint(SC_SL_ERR | SC_EXIT_ERR, "open(\"%s\"): %s",
 261  261                      name, strerror(errno));
 262  262          return (fd);
 263  263  }
 264  264  
 265  265  static void
 266  266  Fread(void *buf, size_t size, FILE *f)
 267  267  {
 268  268          if (fread(buf, size, 1, f) != 1)
 269      -                logprint(SC_SL_ERR | SC_EXIT_ERR, "fread: ferror %d feof %d",
 270      -                    ferror(f), feof(f));
      269 +                logprint(SC_SL_ERR | SC_EXIT_ERR, "fread: %s",
      270 +                    strerror(errno));
 271  271  }
 272  272  
 273  273  static void
 274  274  Fwrite(void *buf, size_t size, FILE *f)
 275  275  {
 276  276          if (fwrite(buf, size, 1, f) != 1)
 277  277                  logprint(SC_SL_ERR | SC_EXIT_ERR, "fwrite: %s",
 278  278                      strerror(errno));
 279  279  }
 280  280  
↓ open down ↓ 1716 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX