mirror of
https://github.com/kdlucas/byte-unixbench.git
synced 2025-03-12 00:00:07 +08:00
clean up namedpipes
This commit is contained in:
parent
569137edd1
commit
87beeb64da
@ -28,10 +28,17 @@ char SCCSid[] = "@(#) @(#)context2.c:0.1 -- 8/06/24 11:11:11";
|
|||||||
#include "timeit.c"
|
#include "timeit.c"
|
||||||
|
|
||||||
unsigned long iter;
|
unsigned long iter;
|
||||||
|
char fifo1_name[] = "/tmp/test_fifo1XXXXXX";
|
||||||
|
char fifo2_name[] = "/tmp/test_fifo2XXXXXX";
|
||||||
|
|
||||||
void report()
|
void report()
|
||||||
{
|
{
|
||||||
fprintf(stderr, "COUNT|%lu|1|lps\n", iter);
|
fprintf(stderr, "COUNT|%lu|1|lps\n", iter);
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
unlink(fifo1_name);
|
||||||
|
unlink(fifo2_name);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,8 +48,6 @@ int main(int argc, char *argv[])
|
|||||||
unsigned long check;
|
unsigned long check;
|
||||||
int fd1_read, fd1_write, fd2_read, fd2_write;
|
int fd1_read, fd1_write, fd2_read, fd2_write;
|
||||||
ssize_t ret;
|
ssize_t ret;
|
||||||
char fifo1_name[] = "/tmp/test_fifo1XXXXXX";
|
|
||||||
char fifo2_name[] = "/tmp/test_fifo2XXXXXX";
|
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr, "Usage: context duration\n");
|
fprintf(stderr, "Usage: context duration\n");
|
||||||
@ -151,8 +156,5 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
|
||||||
unlink(fifo1_name);
|
|
||||||
unlink(fifo2_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,10 +28,15 @@ char SCCSid[] = "@(#) @(#)named_pipe.c:0.1 -- 8/06/24 11:11:11";
|
|||||||
#include "timeit.c"
|
#include "timeit.c"
|
||||||
|
|
||||||
unsigned long iter;
|
unsigned long iter;
|
||||||
|
char fifo_name[] = "/tmp/test_fifoXXXXXX";
|
||||||
|
|
||||||
void report()
|
void report()
|
||||||
{
|
{
|
||||||
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
|
fprintf(stderr,"COUNT|%ld|1|lps\n", iter);
|
||||||
|
|
||||||
|
// Clean up
|
||||||
|
unlink(fifo_name);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +44,6 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
char buf[512];
|
char buf[512];
|
||||||
int fd_read, fd_write, duration;
|
int fd_read, fd_write, duration;
|
||||||
char fifo_name[] = "/tmp/test_fifoXXXXXX";
|
|
||||||
|
|
||||||
if (argc != 2) {
|
if (argc != 2) {
|
||||||
fprintf(stderr,"Usage: %s duration\n", argv[0]);
|
fprintf(stderr,"Usage: %s duration\n", argv[0]);
|
||||||
@ -88,10 +92,4 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
iter++;
|
iter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up
|
|
||||||
close(fd_read);
|
|
||||||
close(fd_write);
|
|
||||||
unlink(fifo_name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user