blob: 17a456067244614dfe0a0a758c2e5f8f4833bf11 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
/*
* sb_close.c
*
* IO functions.
*
* Copyright 1999-2008 Gentoo Foundation
* Licensed under the GPL-2
*/
#include "headers.h"
#include "sbutil.h"
/* General purpose function to _reliably_ close a file
*
* Returns 0 if successful or negative number on error (and errno set)
*/
int sb_close(int fd)
{
int res;
do {
res = close(fd);
} while ((res < 0) && (EINTR == errno));
/* Do not care about errors here */
if (-1 != res)
errno = 0;
return res;
}
|