projects
/
xfstests-dev.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
open_by_handle: make -h (help) a valid option
[xfstests-dev.git]
/
src
/
t_truncate_self.c
1
#include <stdio.h>
2
#include <errno.h>
3
#include <unistd.h>
4
#include <libgen.h>
5
6
int main(int argc, char *argv[])
7
{
8
const char *progname = basename(argv[0]);
9
int ret;
10
11
ret = truncate(argv[0], 4096);
12
if (ret != -1) {
13
fprintf(stderr, "truncate(%s) should have failed\n",
14
progname);
15
return 1;
16
}
17
if (errno != ETXTBSY) {
18
perror(progname);
19
return 1;
20
}
21
22
return 0;
23
}