From 9c2ebc50efa9c120b1969e78cea2f5256416b5b9 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 23 Feb 2012 11:26:32 -0500 Subject: [PATCH] No need to declare INADDR_NONE here, it's a unix domain socket. --- ctdlsh/README | 3 +++ ctdlsh/src/shutdown.c | 4 ---- ctdlsh/src/sockets.c | 17 ++++++++++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ctdlsh/README b/ctdlsh/README index 38b234e6c..35143f931 100644 --- a/ctdlsh/README +++ b/ctdlsh/README @@ -5,3 +5,6 @@ submit patches, but if you attempt to use it in a production system or if you request support for the program, you will be told to die in a car fire. +This is open source software. It runs really well on the Linux operating +system. We reject Richard Stallman's linguistic fascism and so should you. + diff --git a/ctdlsh/src/shutdown.c b/ctdlsh/src/shutdown.c index cab803604..a3c253f16 100644 --- a/ctdlsh/src/shutdown.c +++ b/ctdlsh/src/shutdown.c @@ -24,7 +24,3 @@ int cmd_shutdown(int server_socket, char *cmdbuf) { fprintf(stderr, "%s\n", &buf[4]); return(cmdret_ok); } - - - - diff --git a/ctdlsh/src/sockets.c b/ctdlsh/src/sockets.c index 0d914b6ab..3aaf77140 100644 --- a/ctdlsh/src/sockets.c +++ b/ctdlsh/src/sockets.c @@ -1,12 +1,14 @@ /* - * + * This file contains functions which handle ctdlsh's connection + * to the Citadel server's admin socket. + * + * Copyright (c) 2009-2012 by the Citadel.org team. + * This program is open source software, cheerfully made available to you under + * the terms of the GNU General Public License version 3. */ #include "ctdlsh.h" -#ifndef INADDR_NONE -#define INADDR_NONE 0xffffffff -#endif int uds_connectsock(char *sockpath) { @@ -102,7 +104,6 @@ int sock_write(int sock, char *buf, int nbytes) } - /* * Input string from socket - implemented in terms of sock_read() * @@ -138,9 +139,8 @@ int sock_getln(int sock, char *buf, int bufsize) } - /* - * sock_puts() - send line to server - implemented in terms of serv_write() + * sock_puts() - send line to server - implemented in terms of sock_write() * Returns the number of bytes written, or -1 for error. */ int sock_puts(int sock, char *buf) @@ -155,6 +155,9 @@ int sock_puts(int sock, char *buf) } +/* + * Write a formatted string to the server - implemented in terms of sock_write() + */ void sock_printf(int sock, const char *format,...) { va_list arg_ptr; -- 2.30.2