repo.or.cz
/
remote
/
remote-mci.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Reorganize to remove DIKU specific naming
[remote/remote-mci.git]
/
mch
/
notify
/
notify.c
blob
efb9717ec28ba1b91ac10563aba7a63ca58b0f59
1
#include <unistd.h>
2
#include <sys/types.h>
3
#include <sys/stat.h>
4
#include <fcntl.h>
5
#include <unistd.h>
6
7
int
plugpipe
;
8
9
int
main
(
int
argc
,
char
*
argv
[])
10
{
11
if
(
argc
<
1
)
return
-
1
;
12
// wait a bit before attempting to write
13
usleep
(
5000000
);
14
plugpipe
=
open
(
argv
[
1
],
O_WRONLY
|
O_NONBLOCK
);
15
if
(
plugpipe
<
0
)
16
{
17
return
-
2
;
18
}
19
20
if
(
write
(
plugpipe
,
"p"
,
1
) <
1
)
21
{
22
close
(
plugpipe
);
23
return
-
3
;
24
}
25
close
(
plugpipe
);
26
return
0
;
27
}