commit 0bfec25649cc4b4d986a0073f796964e9f8fef1d
parent 9894ac621463db25fa634bddbd3200cdcec48d57
Author: Kyle Milz <krwmilz@gmail.com>
Date: Sat, 11 Mar 2023 19:49:25 +0000
replace only use of xpipe() with socketpair()
Diffstat:
3 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/popups.c b/popups.c
@@ -27,6 +27,7 @@ IN THE SOFTWARE.
* Code for popup windows.
*/
+#include <sys/socket.h> /* socketpair */
#include <sys/stat.h>
#include <sys/wait.h>
@@ -1337,8 +1338,8 @@ print_do_it()
for (pp = argv + 1; pp <= argnext; ++pp) (*pp)[-1] = '\0';
*argnext = NULL;
- if (xpipe(print_io) != 0) {
- perror("[xdvi] pipe");
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, print_io) != 0) {
+ warnx("pipe");
return;
}
diff --git a/util.c b/util.c
@@ -25,7 +25,6 @@ NOTE:
\*========================================================================*/
-#include <sys/socket.h>
#include <sys/file.h> /* this defines FASYNC */
#include <sys/ioctl.h> /* this defines SIOCSPGRP and FIOASYNC */
@@ -150,25 +149,6 @@ xfopen(const char *filename, const char *type)
/*
- * Create a pipe.
- * We use socketpair() instead of pipe() because several operating
- * systems don't support SIGPOLL/SIGIO on pipes:
- * SGI IRIX 6.5 F_SETOWN not implemented
- * Linux 2.4.2 Not supported
- */
-
-int
-xpipe(int *fd)
-{
- int retval;
-
- retval = socketpair(AF_UNIX, SOCK_STREAM, 0, fd);
-
- return retval;
-}
-
-
-/*
* Perform tilde expansion, updating the character pointer unless the
* user was not found.
*/
diff --git a/util.h b/util.h
@@ -21,8 +21,6 @@ const struct passwd *ff_getpw(const char **, const char *);
void prep_fd(int, Boolean);
FILE *xfopen(const char *, const char *);
-int xpipe(int *);
-
void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(const char *);