mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
gcc -O2 -g -Wall -Werror -I ../../../compel/include/uapi -o spy spy.c ../../../compel/libcompel.a
spy.c: In function ‘check_pipe_ends’:
spy.c:107:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
107 | write(wfd, "1", 2);
| ^~~~~~~~~~~~~~~~~~
spy.c:108:2: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
108 | read(rfd, aux, sizeof(aux));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
17 lines
219 B
C
17 lines
219 B
C
#include <unistd.h>
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
int i;
|
|
|
|
while (1) {
|
|
if (read(0, &i, sizeof(i)) != sizeof(i))
|
|
break;
|
|
|
|
i = getsid(0);
|
|
if (write(1, &i, sizeof(i)) != sizeof(i))
|
|
break;
|
|
}
|
|
|
|
return 0;
|
|
}
|