Add proper deps. Add destdir support. And, finally, make it build properly. (82 (small) patches later...)
41 lines
1.4 KiB
Text
41 lines
1.4 KiB
Text
$NetBSD: patch-db,v 1.1 2008/08/31 06:52:29 dholland Exp $
|
|
|
|
--- server/socket.c~ 1998-01-08 14:59:17.000000000 -0500
|
|
+++ server/socket.c 2008-08-31 02:22:10.000000000 -0400
|
|
@@ -37,6 +37,9 @@
|
|
#include <netinet/in.h>
|
|
#include <netinet/tcp.h>
|
|
#endif
|
|
+#include <stdio.h>
|
|
+#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include <netdb.h>
|
|
#include <fcntl.h>
|
|
#include <errno.h>
|
|
@@ -84,7 +87,7 @@ socket_as_Xserver
|
|
if (!mkdir(X_UNIX_DIR, 0777))
|
|
chmod(X_UNIX_DIR, 0777);
|
|
|
|
- (void)sprintf(xpath, "%s%d", X_UNIX_PATH, display);
|
|
+ (void)snprintf(xpath, sizeof(xpath), "%s%d", X_UNIX_PATH, display);
|
|
rv = create_port(XPORT, X_TCP_PORT+display, xpath);
|
|
|
|
(void)umask(umsk);
|
|
@@ -111,7 +114,7 @@ socket_as_xmc
|
|
if (!mkdir(XMC_UNIX_DIR, 0777))
|
|
chmod(XMC_UNIX_DIR, 0777);
|
|
|
|
- (void)sprintf(xmcpath, "%s%d", XMC_UNIX_PATH, display);
|
|
+ (void)snprintf(xmcpath, sizeof(xmcpath), "%s%d", XMC_UNIX_PATH, display);
|
|
rv = create_port(XMCPORT, XMC_TCP_PORT-display, xmcpath);
|
|
|
|
(void)umask(umsk);
|
|
@@ -393,7 +396,7 @@ socket_as_client
|
|
case FamilyLocal:
|
|
#ifdef UNIXCONN
|
|
usock.sun_family = AF_UNIX;
|
|
- sprintf(usock.sun_path, "%s%d", X_UNIX_PATH, display);
|
|
+ snprintf(usock.sun_path, sizeof(usock.sun_path), "%s%d", X_UNIX_PATH, display);
|
|
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
|
return perr(-1, usock.sun_path);
|
|
sock = (struct sockaddr *)&usock;
|