pass through an arg

This commit is contained in:
Vincent Batts 2017-11-05 22:19:48 -05:00
parent 7e5df725d8
commit 424d185294
2 changed files with 12 additions and 6 deletions

View file

@ -11,16 +11,21 @@
int main(int argc, char ** argv) {
int fd = -1;
int ret;
int i;
fd = open(HELLOCTL, O_RDONLY);
if (fd < 0) {
fprintf(stderr, "Could not open %s\n", HELLOCTL);
_exit(1);
}
int ret;
if (ret = ioctl(fd, 1, 1) < 0) {
fprintf(stderr, "ioctl failed with: %s\n", strerror(ret));
goto done;
for (i=1; i<argc; i++) {
if (ret = ioctl(fd, 1, argv[i]) < 0) {
fprintf(stderr, "ioctl failed with: %s\n", strerror(ret));
goto done;
}
}
done:
close(fd);