From 2e3b3a2816d9234e75051287b56874a480140958 Mon Sep 17 00:00:00 2001 From: Daniel Borkmann Date: Tue, 21 Feb 2012 10:54:14 +0100 Subject: [PATCH] write_or_die: renamed to more appropriate name, changed other files that have ref to it --- src/ashunt.c | 2 +- src/ashunt/CMakeLists.txt | 2 +- src/ct_client.c | 2 +- src/ct_server.c | 2 +- src/curvetun.c | 2 +- src/curvetun/CMakeLists.txt | 2 +- src/mtrand.c | 2 +- src/netsniff-ng.c | 2 +- src/netsniff-ng/CMakeLists.txt | 2 +- src/pcap_mmap.c | 2 +- src/pcap_rw.c | 2 +- src/pcap_sg.c | 2 +- src/trafgen/CMakeLists.txt | 2 +- src/usermgmt.c | 2 +- src/{write_or_die.c => xio.c} | 2 +- src/{write_or_die.h => xio.h} | 13 ++++--------- 16 files changed, 19 insertions(+), 24 deletions(-) rename src/{write_or_die.c => xio.c} (98%) rename src/{write_or_die.h => xio.h} (66%) diff --git a/src/ashunt.c b/src/ashunt.c index 59e657ac..29947f2c 100644 --- a/src/ashunt.c +++ b/src/ashunt.c @@ -232,7 +232,7 @@ Please report bugs to #include "tprintf.h" #include "proto_hex.h" #include "xmalloc.h" -#include "write_or_die.h" +#include "xio.h" #include "aslookup.h" #include "signals.h" #include "netdev.h" diff --git a/src/ashunt/CMakeLists.txt b/src/ashunt/CMakeLists.txt index 43ff6256..ae578e03 100644 --- a/src/ashunt/CMakeLists.txt +++ b/src/ashunt/CMakeLists.txt @@ -8,7 +8,7 @@ FIND_PACKAGE(Threads) IF (LIBGEOIP_FOUND AND CMAKE_HAVE_PTHREAD_CREATE) ADD_EXECUTABLE(${PROJECT_NAME} ../xmalloc.c ../strlcpy.c - ../write_or_die.c + ../xio.c ../misc.c ../netdev.c ../aslookup.c diff --git a/src/ct_client.c b/src/ct_client.c index 2f05053b..f53bf4c1 100644 --- a/src/ct_client.c +++ b/src/ct_client.c @@ -28,7 +28,7 @@ #include #include "die.h" -#include "write_or_die.h" +#include "xio.h" #include "strlcpy.h" #include "curve.h" #include "mtrand.h" diff --git a/src/ct_server.c b/src/ct_server.c index c923f888..e226a82f 100644 --- a/src/ct_server.c +++ b/src/ct_server.c @@ -31,7 +31,7 @@ #include "die.h" #include "netdev.h" -#include "write_or_die.h" +#include "xio.h" #include "psched.h" #include "xmalloc.h" #include "curvetun.h" diff --git a/src/curvetun.c b/src/curvetun.c index edbc809d..a14ea4a3 100644 --- a/src/curvetun.c +++ b/src/curvetun.c @@ -58,7 +58,7 @@ #include "curve.h" #include "usermgmt.h" #include "servmgmt.h" -#include "write_or_die.h" +#include "xio.h" #include "crypto_verify_32.h" #include "crypto_box_curve25519xsalsa20poly1305.h" #include "crypto_scalarmult_curve25519.h" diff --git a/src/curvetun/CMakeLists.txt b/src/curvetun/CMakeLists.txt index 844eccd4..797cdd74 100644 --- a/src/curvetun/CMakeLists.txt +++ b/src/curvetun/CMakeLists.txt @@ -11,7 +11,7 @@ IF (NACL_FOUND AND CMAKE_THREAD_LIBS_INIT) ADD_EXECUTABLE(${PROJECT_NAME} ../xmalloc.c ../strlcpy.c - ../write_or_die.c + ../xio.c ../cpusched.c ../netdev.c ../stun.c diff --git a/src/mtrand.c b/src/mtrand.c index 72d0b10f..67b4e337 100644 --- a/src/mtrand.c +++ b/src/mtrand.c @@ -55,7 +55,7 @@ #include #include "mtrand.h" -#include "write_or_die.h" +#include "xio.h" #define N 624 #define M 397 diff --git a/src/netsniff-ng.c b/src/netsniff-ng.c index 27356ae9..7b3feb23 100644 --- a/src/netsniff-ng.c +++ b/src/netsniff-ng.c @@ -45,7 +45,7 @@ #include "poll.h" #include "bpf.h" #include "signals.h" -#include "write_or_die.h" +#include "xio.h" #include "die.h" #include "tty.h" #include "opt_memcpy.h" diff --git a/src/netsniff-ng/CMakeLists.txt b/src/netsniff-ng/CMakeLists.txt index 3ce8bd76..03b51c00 100644 --- a/src/netsniff-ng/CMakeLists.txt +++ b/src/netsniff-ng/CMakeLists.txt @@ -18,7 +18,7 @@ IF (CMAKE_HAVE_PTHREAD_CREATE) ../pcap_rw.c ../pcap_sg.c ../pcap_mmap.c - ../write_or_die.c + ../xio.c ../ring_rx.c ../ring_tx.c ../mtrand.c diff --git a/src/pcap_mmap.c b/src/pcap_mmap.c index b70b9b2f..72a96c16 100644 --- a/src/pcap_mmap.c +++ b/src/pcap_mmap.c @@ -14,7 +14,7 @@ #include #include "pcap.h" -#include "write_or_die.h" +#include "xio.h" #include "opt_memcpy.h" #include "locking.h" diff --git a/src/pcap_rw.c b/src/pcap_rw.c index f1b6ce10..d3170349 100644 --- a/src/pcap_rw.c +++ b/src/pcap_rw.c @@ -13,7 +13,7 @@ #include "pcap.h" #include "compiler.h" -#include "write_or_die.h" +#include "xio.h" #include "die.h" static int pcap_rw_pull_file_header(int fd) diff --git a/src/pcap_sg.c b/src/pcap_sg.c index 27b14e3d..2db3ca18 100644 --- a/src/pcap_sg.c +++ b/src/pcap_sg.c @@ -15,7 +15,7 @@ #include "pcap.h" #include "xmalloc.h" -#include "write_or_die.h" +#include "xio.h" #include "opt_memcpy.h" #include "locking.h" diff --git a/src/trafgen/CMakeLists.txt b/src/trafgen/CMakeLists.txt index ff535353..11c4e623 100644 --- a/src/trafgen/CMakeLists.txt +++ b/src/trafgen/CMakeLists.txt @@ -9,7 +9,7 @@ ADD_EXECUTABLE(${PROJECT_NAME} ../xmalloc.c ../parser.c ../mtrand.c ../opt_memcpy.c - ../write_or_die.c + ../xio.c ../ring_tx.c ../netdev.c ../trafgen.c) diff --git a/src/usermgmt.c b/src/usermgmt.c index 5ccf7b43..decd591a 100644 --- a/src/usermgmt.c +++ b/src/usermgmt.c @@ -20,7 +20,7 @@ #include "parser.h" #include "locking.h" #include "xmalloc.h" -#include "write_or_die.h" +#include "xio.h" #include "curvetun.h" #include "strlcpy.h" #include "curve.h" diff --git a/src/write_or_die.c b/src/xio.c similarity index 98% rename from src/write_or_die.c rename to src/xio.c index 736bc49d..27cbb691 100644 --- a/src/write_or_die.c +++ b/src/xio.c @@ -21,7 +21,7 @@ #include #include "die.h" -#include "write_or_die.h" +#include "xio.h" #include "strlcpy.h" int open_or_die(const char *file, int flags) diff --git a/src/write_or_die.h b/src/xio.h similarity index 66% rename from src/write_or_die.h rename to src/xio.h index 145ad73c..e1e39141 100644 --- a/src/write_or_die.h +++ b/src/xio.h @@ -5,20 +5,15 @@ * Subject to the GPL, version 2. */ -#ifndef WRITE_OR_DIE_H -#define WRITE_OR_DIE_H +#ifndef XIO_H +#define XIO_H -extern void fsync_or_die(int fd, const char *msg); extern int open_or_die(const char *file, int flags); extern int open_or_die_m(const char *file, int flags, mode_t mode); extern int tun_open_or_die(char *name, int type); extern ssize_t read_or_die(int fd, void *buf, size_t count); +extern ssize_t write_or_die(int fd, const void *buf, size_t count); extern ssize_t read_exact(int fd, void *buf, size_t len, int mayexit); extern ssize_t write_exact(int fd, void *buf, size_t len, int mayexit); -extern ssize_t write_or_die(int fd, const void *buf, size_t count); -extern ssize_t write_or_whine_pipe(int fd, const void *buf, size_t len, - const char *msg); -extern ssize_t write_or_whine(int fd, const void *buf, size_t len, - const char *msg); -#endif /* WRITE_OR_DIE_H */ +#endif /* XIO_H */ -- 2.11.4.GIT