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

Contents of /trunk/libsbutil/sb_close.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 369 - (hide annotations) (download) (as text)
Sun Nov 9 09:48:28 2008 UTC (5 years, 10 months ago) by vapier
File MIME type: text/x-csrc
File size: 537 byte(s)
cleanup whitespace and comments -- no functional changes
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     #include <errno.h>
11     #include <stdio.h>
12     #include <sys/stat.h>
13     #include <unistd.h>
14     #include <fcntl.h>
15    
16     #include "sbutil.h"
17    
18    
19     /* General purpose function to _reliably_ close a file
20     *
21     * Returns 0 if successful or negative number on error (and errno set)
22     */
23    
24     int sb_close(int fd)
25     {
26     int res;
27    
28     do {
29     res = close(fd);
30     } while ((res < 0) && (EINTR == errno));
31    
32     /* Do not care about errors here */
33     errno = 0;
34    
35     return res;
36     }

  ViewVC Help
Powered by ViewVC 1.1.20