tests/: Avoid closing invalid fd's
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 5 Nov 2013 04:58:40 +0000 (12:58 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 11 Nov 2013 14:36:32 +0000 (22:36 +0800)
commitccba409d349211d0705a8ae1fcf0f88fbb370175
treeb0acb5ded7ab52e9d15253b84b4f081e7d9eab62
parent172aaa3a0135fe14567b33389cfbf25103260967
tests/: Avoid closing invalid fd's

...and only include unistd.h when we are on *NIX.

Newer Visual C++ runtimes (8.0/2005 and later) will cause the program to
crash with an internal abort() call when they detect instances of close()
being called on an invalid fd, such as when the fd is -1, and these should
be purged anyways.

https://bugzilla.gnome.org/show_bug.cgi?id=711047
tests/file-test.c
tests/testglib.c