mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
util: added cleanup_file attribute.
Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
parent
d4d3937017
commit
ea2ddb886a
@ -406,6 +406,14 @@ static inline void cleanup_freep(void *p)
|
|||||||
free(*pp);
|
free(*pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define cleanup_file __attribute__((cleanup(cleanup_filep)))
|
||||||
|
static inline void cleanup_filep(FILE **f)
|
||||||
|
{
|
||||||
|
FILE *file = *f;
|
||||||
|
if (file)
|
||||||
|
(void)fclose(file);
|
||||||
|
}
|
||||||
|
|
||||||
extern int run_command(char *buf, size_t buf_size, int (*child_fn)(void *), void *args);
|
extern int run_command(char *buf, size_t buf_size, int (*child_fn)(void *), void *args);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user