in = fopen(context->batch, "r");
if (in == NULL) {
fprintf(stderr, "%s: error failed to open file '%s': %s\n",
- command, context->batch, strerror(-errno));
+ command, context->batch, strerror(errno));
my_exit(context, EXIT_FAILURE);
}
}
fd = open(source_file, O_RDONLY);
if (fd < 0) {
fprintf(stderr, _("Unable to open input file '%s': %s\n"),
- source_file, strerror(-errno));
+ source_file, strerror(errno));
return 1;
}
}
buf = buf2;
}
if (r < 0) {
- fprintf(stderr, _("Read error: %s\n"), strerror(-errno));
+ fprintf(stderr, _("Read error: %s\n"), strerror(errno));
goto _err;
}
fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
if (fd < 0) {
fprintf(stderr, _("Unable to open output file '%s': %s\n"),
- fname, strerror(-errno));
+ fname, strerror(errno));
return 1;
}
}
}
if (r < 0) {
- fprintf(stderr, _("Write error: %s\n"), strerror(-errno));
+ fprintf(stderr, _("Write error: %s\n"), strerror(errno));
if (fd != fileno(stdout)) {
if (fname && remove(fname))
fprintf(stderr, _("Unable to remove file %s: %s\n"),
- fname, strerror(-errno));
+ fname, strerror(errno));
close(fd);
}
return 1;
if (fname && rename(fname, output_file)) {
fprintf(stderr, _("Unable to rename file '%s' to '%s': %s\n"),
- fname, output_file, strerror(-errno));
+ fname, output_file, strerror(errno));
return 1;
}