-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not build on FreeBSD 9 #17
Comments
I've added a patch to ports tree to fix it: https://svnweb.freebsd.org/ports/head/net/dpinger/files/patch-dpinger.c?revision=404730&view=markup |
Okay, thanks Renato. Btw, I assume the ports tree doesn't allow conditional patches based on target version? I added a temporary fix. |
Didn't you like the fcntl() fix? |
No, your fcntl() change was just fine. I was looking at all the descriptors for close on exec and ran into other problems. The remaining issue is the file descriptor from accept(). Since accept/fcntl isn't atomic, this fd is left exposed. I would like to use accept4(), but this has some issues on some Linux systems (you have to define __USE_GNU which I don't want to do), and isn't present in older FreeBSD systems. Given that I can't fix it completely on any system, I'm going to change it back to fcntl() in all locations and revisit it in a year. After many years of coding for maximum portability and legacy systems, I've become tired of it. I have grown to absolutely hate ifdefs. :) |
I've pushed an update that covers all the FDs as best as can be done with fcntl(). Please let me know if you run into any other problems. Many thanks. |
SOCK_CLOEXEC was added in FreeBSD 10.0 [1], it's better if fcntl() is used instead
[1] https://wiki.freebsd.org/AtomicCloseOnExec
Warning: Object directory not changed from original /wrkdirs/usr/ports/net/dpinger/work/dpinger-1.1
cc -O2 -pipe -fno-strict-aliasing -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c dpinger.c
dpinger.c: In function 'main':
dpinger.c:1120: error: 'SOCK_CLOEXEC' undeclared (first use in this function)
dpinger.c:1120: error: (Each undeclared identifier is reported only once
dpinger.c:1120: error: for each function it appears in.)
*** [dpinger.o] Error code 1
Stop in /wrkdirs/usr/ports/net/dpinger/work/dpinger-1.1.
*** [do-build] Error code 1
Stop in /usr/ports/net/dpinger.
The text was updated successfully, but these errors were encountered: