summaryrefslogtreecommitdiffstats
path: root/tests/c-api/test-last-errno.c
Commit message (Collapse)AuthorAgeFilesLines
* Replace mount-options with mount where appropriate.Richard W.M. Jones2012-08-181-1/+1
| | | | | | Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs.
* tests: Fix broken workarounds for missing O_CLOEXEC.Richard W.M. Jones2012-06-221-1/+1
|
* Use O_CLOEXEC / SOCK_CLOEXEC for almost all file descriptors.Richard W.M. Jones2012-03-141-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | The presumption is that all file descriptors should be created with the close-on-exec flag set. The only exception are file descriptors that we want passed through to exec'd subprocesses (mainly pipes and stdin/stdout/stderr). For open calls, we pass O_CLOEXEC as an extra flag, eg: fd = open ("foo", O_RDONLY|O_CLOEXEC); This is a Linux-ism, but using a macro we can easily make it portable. For sockets, similarly: sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...); For accepted sockets, we use the Linux accept4 system call which allows flags to be supplied, but we use the Gnulib 'accept4' module to make this portable. For dup, dup2, we use the Linux dup3 system call, and the Gnulib modules 'dup3' and 'cloexec'.
* tests: Rename capitests -> tests/c-api.Richard W.M. Jones2011-12-221-0/+142