X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=blobdiff_plain;f=tests%2Ftest-passfd.c;fp=tests%2Ftest-passfd.c;h=a61c0ecd4ad42fd293d4bdeae2ecb45b5f388fc8;hp=6389e154ee8c0dee743b091e6bf27251f94b38de;hb=458c944ddbb41cd6ba34416db2867eb6f17bf61a;hpb=6a8461af29d6ce87d891ca8e1433848f5f4c45b8 diff --git a/tests/test-passfd.c b/tests/test-passfd.c index 6389e154e..a61c0ecd4 100644 --- a/tests/test-passfd.c +++ b/tests/test-passfd.c @@ -1,5 +1,5 @@ /* Test of passing file descriptors. - Copyright (C) 2011-2013 Free Software Foundation, Inc. + Copyright (C) 2011-2014 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -83,6 +83,7 @@ main () /* father */ else { + ASSERT (close (pair[1]) == 0); fd = recvfd (pair[0], 0); if (fd == -1) { @@ -116,6 +117,13 @@ main () perror ("fstat"); return 80; } + + /* Check behavior when sender no longer around */ + errno = 0; + fd = recvfd (pair[0], 0); + ASSERT (fd == -1); + ASSERT (errno == ENOTCONN); + return 0; } #else