Check the return value in clonefile test
Reviewed-by: Brian Atkinson <batkinson@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Rob Norris <rob.norris@klarasystems.com> Signed-off-by: Kay Pedersen <mail@mkwg.de> Closes #15128
This commit is contained in:
parent
b22bab2547
commit
e9c59310f7
|
@ -212,7 +212,7 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
int dfd = open(argv[optind+1], O_WRONLY|O_CREAT,
|
int dfd = open(argv[optind+1], O_WRONLY|O_CREAT,
|
||||||
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||||
if (sfd < 0) {
|
if (dfd < 0) {
|
||||||
fprintf(stderr, "open: %s: %s\n",
|
fprintf(stderr, "open: %s: %s\n",
|
||||||
argv[optind+1], strerror(errno));
|
argv[optind+1], strerror(errno));
|
||||||
close(sfd);
|
close(sfd);
|
||||||
|
|
Loading…
Reference in New Issue