/[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 - (hide annotations) (download) (as text)
Sun Nov 9 10:29:58 2008 UTC (6 years ago) by vapier
File MIME type: text/x-csrc
File size: 457 byte(s)
consolidate all random system includes into headers.h
1 azarah 317 /*
2 azarah 340 * sb_close.c
3 azarah 317 *
4     * IO functions.
5     *
6 vapier 369 * Copyright 1999-2008 Gentoo Foundation
7     * Licensed under the GPL-2
8 azarah 317 */
9    
10 vapier 370 #include "headers.h"
11 azarah 317 #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