print actual errno

This commit is contained in:
twoneis 2025-04-25 09:29:36 +02:00
parent 9b04614543
commit 79c58aa87a

View file

@ -1,6 +1,7 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sys/socket.h> #include <sys/socket.h>
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -51,7 +52,7 @@ main(void)
int ret; int ret;
ret = pipe2(spray[i], O_NONBLOCK); ret = pipe2(spray[i], O_NONBLOCK);
if (ret < 0) { if (ret < 0) {
printf("main: error: object %lu pipe2: %i\n", i, ret); printf("main: error: object %lu pipe2: %i\n", i, errno);
exit(-1); exit(-1);
} }
ret = fcntl(spray[i][0], F_SETPIPE_SZ, 8192); ret = fcntl(spray[i][0], F_SETPIPE_SZ, 8192);