Allow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpair
authorPino Toscano <toscano.pino@tiscali.it>
Tue, 10 Sep 2013 14:34:07 +0000 (22:34 +0800)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 13 Sep 2013 12:36:32 +0000 (13:36 +0100)
commitc1288c5366f64b45280b4f8865e2efb716663ccd
treef2e322a54fd8515b4d48f155522d85b572f366ee
parent7a53684d422d10d5e89ff0dee7f3c7539de11341
Allow EPROTOTYPE for SOCK_CLOEXEC but unsupported by socket/socketpair

If SOCK_CLOEXEC is defined (usually because accept4 is implemented),
check for EPROTOTYPE (the POSIX errno for invalid socket types) in
addition to EINVAL as errno indicating whether socket and socketpair
do not support SOCK_CLOEXEC (and other SOCK_* flags).

[adapted by Chengwei Yang to give _dbus_connect_exec() the same treatment]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69073
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-sysdeps-unix.c