stat.c: Simplify stat_client_write().
[paraslash.git] / command.c
index c7d1c46791aa09f439bb553e1f8cfdf543f9b51c..aed9e6a0a34ab94ea6fce7b5708ac0b6e228efd2 100644 (file)
--- a/command.c
+++ b/command.c
@@ -108,7 +108,7 @@ static char *get_status(struct misc_meta_data *nmmd)
        flags = vss_get_status_flags(nmmd->vss_status_flags);
        if (nmmd->size) { /* parent currently has an audio file open */
                localtime_r(&nmmd->mtime, &mtime_tm);
-               strftime(mtime, 29, "%a %b %d %Y", &mtime_tm);
+               strftime(mtime, 29, "%b %d %Y", &mtime_tm);
        }
        gettimeofday(&now, NULL);
        ret = make_message(
@@ -278,7 +278,7 @@ int com_si(int fd, int argc, __a_unused char * const * argv)
                "supported senders: %s\n"
                "%s",
                ut, mmd->num_played,
-               getppid(),
+               (int)getppid(),
                mmd->active_connections,
                mmd->num_commands,
                mmd->num_connects,
@@ -654,8 +654,8 @@ out:
 /**
  * perform user authentication and execute a command
  *
- * \param fd the file descriptor to send output to
- * \param addr socket address info of peer
+ * \param fd       The file descriptor to send output to
+ * \param peername  Identifies the connecting peer.
  *
  * \return EXIT_SUCCESS or EXIT_FAILURE
  *
@@ -680,7 +680,7 @@ out:
  *
  * \sa alarm(2), rc4(3), crypt.c, crypt.h
  */
-int handle_connect(int fd, struct sockaddr_in *addr)
+int handle_connect(int fd, const char *peername)
 {
        int ret, argc, use_rc4 = 0;
        char buf[4096];
@@ -790,7 +790,7 @@ int handle_connect(int fd, struct sockaddr_in *addr)
        mmd->num_commands++;
        mmd_unlock();
        PARA_NOTICE_LOG("calling com_%s() for %s@%s\n", cmd->name, u->name,
-               inet_ntoa(addr->sin_addr));
+                       peername);
        ret = cmd->handler(fd, argc, argv);
        if (ret >= 0) {
                ret = EXIT_SUCCESS;