Changeset 0519a87 in code


Ignore:
Timestamp:
Jan 18, 2015, 8:46:13 PM (10 years ago)
Author:
Mike Belopuhov <mike@…>
Branches:
master
Children:
cb7c494
Parents:
8f5ba64
git-author:
Mike Belopuhov <mike@…> (01/18/15 16:05:42)
git-committer:
Mike Belopuhov <mike@…> (01/18/15 20:46:13)
Message:

param.h and MAXHOSTNAMELEN cleanup

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cmd.c

    r8f5ba64 r0519a87  
    1515 */
    1616
    17 #include <sys/param.h>
     17#include <sys/types.h>
    1818#include <sys/queue.h>
     19#include <netdb.h>
    1920#include <stdio.h>
    2021#include <stdlib.h>
  • icb.c

    r8f5ba64 r0519a87  
    1515 */
    1616
    17 #include <sys/param.h>
     17#include <sys/types.h>
    1818#include <sys/queue.h>
     19#include <netdb.h>
    1920#include <stdarg.h>
    2021#include <stdio.h>
     
    3132
    3233extern int creategroups;
    33 extern char srvname[MAXHOSTNAMELEN];
     34extern char srvname[NI_MAXHOST];
    3435
    3536void   icb_command(struct icb_session *, char *, char *);
     
    5051                (void)gethostname(srvname, sizeof srvname);
    5152        /*
    52          * MAXHOSTNAMELEN is usually greater than what we
     53         * NI_MAXHOST is usually greater than what we
    5354         * can actually send, hence truncation:
    5455         */
     
    185186        if (client && strlen(client) > 0)
    186187                icb_vis(is->client, client, sizeof is->client, VIS_SP);
     188        else
     189                strlcpy(is->client, is->nick, sizeof is->client);
    187190        is->group = ig;
    188191        is->login = time(NULL);
  • icb.h

    r8f5ba64 r0519a87  
    7777        char                     client[ICB_MAXNICKLEN];
    7878        char                     host[ICB_MAXHOSTLEN];
    79         char                     hostname[MAXHOSTNAMELEN];
     79        char                     hostname[NI_MAXHOST];
    8080        char                     buffer[ICB_MSGSIZE];
    8181        struct sockaddr_storage  ss;
  • icbd.h

    r8f5ba64 r0519a87  
    2020#define TCP_BACKLOG     5
    2121
     22#ifndef MIN
     23#define MIN(x, y)       ((x) < (y) ? (x) : (y))
     24#endif
     25
    2226#define EVBUFFER_FD(x)  (EVENT_FD(&(x)->ev_read))
    2327
  • logger.c

    r8f5ba64 r0519a87  
    1616 */
    1717
    18 #include <sys/param.h>
     18#include <sys/types.h>
    1919#include <sys/socket.h>
    2020#include <sys/stat.h>
    2121#include <sys/time.h>
    22 #include <sys/types.h>
    2322#include <sys/uio.h>
    2423#include <errno.h>
     24#include <netdb.h>
    2525#include <stdlib.h>
    2626#include <string.h>
Note: See TracChangeset for help on using the changeset viewer.