tr: properly detect read errors (Fernando Silveira <fsilveira@gmail.com>)

readprofile: use xwrite

function                                             old     new   delta
tr_main                                              679     677      -2
readprofile_main                                    1964    1944     -20
This commit is contained in:
Denis Vlasenko
2007-11-13 17:51:40 +00:00
parent 130f559f4d
commit a89d50fb9a
2 changed files with 6 additions and 7 deletions

View File

@@ -88,10 +88,7 @@ int readprofile_main(int argc, char **argv)
}
fd = xopen(defaultpro, O_WRONLY);
if (full_write(fd, &multiplier, to_write) != to_write)
bb_perror_msg_and_die("error writing %s", defaultpro);
xwrite(fd, &multiplier, to_write);
close(fd);
return EXIT_SUCCESS;
}