/[path-sandbox]/trunk/libsbutil/sb_close.c
Gentoo

Contents of /trunk/libsbutil/sb_close.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 370 - (show annotations) (download) (as text)
Sun Nov 9 10:29:58 2008 UTC (5 years, 10 months ago) by vapier
File MIME type: text/x-csrc
File size: 457 byte(s)
consolidate all random system includes into headers.h
1 /*
2 * sb_close.c
3 *
4 * IO functions.
5 *
6 * Copyright 1999-2008 Gentoo Foundation
7 * Licensed under the GPL-2
8 */
9
10 #include "headers.h"
11 #include "sbutil.h"
12
13 /* General purpose function to _reliably_ close a file
14 *
15 * Returns 0 if successful or negative number on error (and errno set)
16 */
17
18 int sb_close(int fd)
19 {
20 int res;
21
22 do {
23 res = close(fd);
24 } while ((res < 0) && (EINTR == errno));
25
26 /* Do not care about errors here */
27 errno = 0;
28
29 return res;
30 }

  ViewVC Help
Powered by ViewVC 1.1.20