Don't close file and pipe that were not opened.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
a77f15a1e4
Коммит
d38a0e345a
@ -480,10 +480,14 @@ f_trunc (FBUF * fs)
|
|||||||
static int
|
static int
|
||||||
f_close (FBUF * fs)
|
f_close (FBUF * fs)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv = -1;
|
||||||
|
|
||||||
|
if (fs != NULL)
|
||||||
|
{
|
||||||
|
rv = close (fs->fd);
|
||||||
|
f_free (fs);
|
||||||
|
}
|
||||||
|
|
||||||
rv = close (fs->fd);
|
|
||||||
f_free (fs);
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -541,14 +545,19 @@ p_open (const char *cmd, int flags)
|
|||||||
static int
|
static int
|
||||||
p_close (FBUF * fs)
|
p_close (FBUF * fs)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv = -1;
|
||||||
|
|
||||||
|
if (fs != NULL)
|
||||||
|
{
|
||||||
|
rv = pclose (fs->data);
|
||||||
|
f_free (fs);
|
||||||
|
}
|
||||||
|
|
||||||
rv = pclose (fs->data);
|
|
||||||
f_free (fs);
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get one char (byte) from string
|
* Get one char (byte) from string
|
||||||
*
|
*
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user