I suggest to change the printf in line:
|
printf("mark: setting SO_MARK for fd=%u to %#x\n", sd, mark); |
to fprintf:
fprintf(stderr, "mark: setting SO_MARK for fd=%u to %#x\n", sd, mark);
this will prevent problems when using commands with pipes or when parsing stdout