No need to declare INADDR_NONE here, it's a unix domain socket.
[citadel.git] / ctdlsh / src / sockets.c
index 1f3ad78eacbcc159cb5a2997c8a8f9abdcffb68f..3aaf7714064666dd55c79edf46462ffd2a5029e2 100644 (file)
@@ -1,25 +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 <config.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
 #include "ctdlsh.h"
 
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
 
 int uds_connectsock(char *sockpath)
 {
@@ -115,7 +104,6 @@ int sock_write(int sock, char *buf, int nbytes)
 }
 
 
-
 /*
  * Input string from socket - implemented in terms of sock_read()
  * 
@@ -151,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)
@@ -168,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;