if (fd == -1) {
fprintf(stderr,"ERROR: failed to open %s (errno=%d)\n",
DATA, (int)errno);
- exit(1);
+ return 1;
}
lock.l_type = F_WRLCK;
if ((ret == -1) ||
(lock.l_type == F_UNLCK)) {
fprintf(stderr,"ERROR: lock test failed (ret=%d errno=%d)\n", ret, (int)errno);
- exit(1);
+ return 1;
} else {
- exit(0);
+ return 0;
}
}
if (fd == -1) {
fprintf(stderr,"ERROR: failed to open %s (errno=%d)\n",
DATA, (int)errno);
- exit(1);
+ return 1;
}
lock.l_type = F_WRLCK;
status);
}
- exit(status);
+ return status;
}