Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 85829
Collapse All | Expand All

(-)old/lclog/lclog.c (-2 / +2 lines)
Lines 226-232 Link Here
226
	{ // handle a user entry
226
	{ // handle a user entry
227
	    if ( !(name = get_name(&lstname, newname)) )
227
	    if ( !(name = get_name(&lstname, newname)) )
228
	    {
228
	    {
229
			name = (struct t_name*)list_add(&lstname, sizeof(struct t_name));
229
			name = (struct t_name*)ll_list_add(&lstname, sizeof(struct t_name));
230
			strcpy(name->name, newname);
230
			strcpy(name->name, newname);
231
			name->secs = newsecs;
231
			name->secs = newsecs;
232
			if ( havecosts )
232
			if ( havecosts )
Lines 248-254 Link Here
248
	{ // handle a line/manually entry
248
	{ // handle a line/manually entry
249
	    if ( !(name = get_name(&lstline, newname)) )
249
	    if ( !(name = get_name(&lstline, newname)) )
250
	    {
250
	    {
251
			name = (struct t_name*)list_add(&lstline, sizeof(struct t_name));
251
			name = (struct t_name*)ll_list_add(&lstline, sizeof(struct t_name));
252
			strcpy(name->name, newname);
252
			strcpy(name->name, newname);
253
253
254
			name->secs = 0;
254
			name->secs = 0;
(-)old/lclog/lists.c (-1 / +1 lines)
Lines 17-23 Link Here
17
 list->count = 0;
17
 list->count = 0;
18
}
18
}
19
19
20
struct list_hdr_t *list_add(struct list_anchor_t *list, int size)
20
struct list_hdr_t *ll_list_add(struct list_anchor_t *list, int size)
21
/* appends an item to the end of the list */
21
/* appends an item to the end of the list */
22
{
22
{
23
 struct list_hdr_t *item;
23
 struct list_hdr_t *item;
(-)old/lclog/lists.h (-1 / +1 lines)
Lines 14-20 Link Here
14
};
14
};
15
15
16
void list_init(struct list_anchor_t *list);
16
void list_init(struct list_anchor_t *list);
17
struct list_hdr_t *list_add(struct list_anchor_t *list, int size);
17
struct list_hdr_t *ll_list_add(struct list_anchor_t *list, int size);
18
void  list_del(struct list_anchor_t *list, struct list_hdr_t *item);
18
void  list_del(struct list_anchor_t *list, struct list_hdr_t *item);
19
void  list_flush(struct list_anchor_t *list);
19
void  list_flush(struct list_anchor_t *list);
20
int   list_count(struct list_anchor_t *list);
20
int   list_count(struct list_anchor_t *list);
(-)old/server/cfg.c (-4 / +4 lines)
Lines 390-396 Link Here
390
 config_set_conf_addrs();
390
 config_set_conf_addrs();
391
 config_load_defaults();
391
 config_load_defaults();
392
 /* create & init default line, id 0 */
392
 /* create & init default line, id 0 */
393
 curline = (struct line_t*)list_add(&lstlines, sizeof(struct line_t));
393
 curline = (struct line_t*)ll_list_add(&lstlines, sizeof(struct line_t));
394
 if ( !curline )
394
 if ( !curline )
395
 {
395
 {
396
     fprintf(stderr, "Not enough memory to load configuration.\n");
396
     fprintf(stderr, "Not enough memory to load configuration.\n");
Lines 425-431 Link Here
425
	    case LCS_CONF_LINE:
425
	    case LCS_CONF_LINE:
426
		// integrity of current line gets checked at the end.
426
		// integrity of current line gets checked at the end.
427
		// let's begin with the settings of a new line
427
		// let's begin with the settings of a new line
428
		curline = (struct line_t*)list_add(&lstlines, sizeof(struct line_t));
428
		curline = (struct line_t*)ll_list_add(&lstlines, sizeof(struct line_t));
429
		if ( !curline )
429
		if ( !curline )
430
		{
430
		{
431
		    fprintf(stderr, "Not enough memory to load configuration.\n");
431
		    fprintf(stderr, "Not enough memory to load configuration.\n");
Lines 599-605 Link Here
599
	        // ok, got new filter entry
599
	        // ok, got new filter entry
600
	        if (server->ipl_type != IPL_INVALID)
600
	        if (server->ipl_type != IPL_INVALID)
601
	        {
601
	        {
602
		    iplentry = (struct ipl_item_t*)list_add(&ipl, sizeof(struct ipl_item_t));
602
		    iplentry = (struct ipl_item_t*)ll_list_add(&ipl, sizeof(struct ipl_item_t));
603
		    if ( !iplentry )
603
		    if ( !iplentry )
604
		    {
604
		    {
605
		        server->ipl_type = IPL_INVALID;
605
		        server->ipl_type = IPL_INVALID;
Lines 632-638 Link Here
632
	        // ok, got new shutdown - filter entry
632
	        // ok, got new shutdown - filter entry
633
	        if (server->shtdn_ipl_type != IPL_INVALID)
633
	        if (server->shtdn_ipl_type != IPL_INVALID)
634
	        {
634
	        {
635
		    iplentry = (struct ipl_item_t*)list_add(&shtdn_ipl, sizeof(struct ipl_item_t));
635
		    iplentry = (struct ipl_item_t*)ll_list_add(&shtdn_ipl, sizeof(struct ipl_item_t));
636
		    if ( !iplentry )
636
		    if ( !iplentry )
637
		    {
637
		    {
638
		        server->shtdn_ipl_type = IPL_INVALID;
638
		        server->shtdn_ipl_type = IPL_INVALID;
(-)old/server/cmd.c (-2 / +2 lines)
Lines 55-61 Link Here
55
 struct ordq_item_t *item;
55
 struct ordq_item_t *item;
56
 int efflen = LC_MAX_MSG_LEN;
56
 int efflen = LC_MAX_MSG_LEN;
57
 if ( msglen < efflen ) efflen = msglen;
57
 if ( msglen < efflen ) efflen = msglen;
58
 if ( (item = (struct ordq_item_t*)list_add(&ordq, sizeof(struct ordq_item_t))) == NULL )
58
 if ( (item = (struct ordq_item_t*)ll_list_add(&ordq, sizeof(struct ordq_item_t))) == NULL )
59
 {
59
 {
60
  syslog(LOG_WARNING, "cmd_q(): malloc(%d) returned NULL", sizeof(struct ordq_item_t));
60
  syslog(LOG_WARNING, "cmd_q(): malloc(%d) returned NULL", sizeof(struct ordq_item_t));
61
  return(-2);
61
  return(-2);
Lines 286-292 Link Here
286
 struct ackq_item_t *item;
286
 struct ackq_item_t *item;
287
 if ( which->cmd >= CBR_INFO ) return(0); // we shouldn't get acks for cmds
287
 if ( which->cmd >= CBR_INFO ) return(0); // we shouldn't get acks for cmds
288
                                          // >= CBR_INFO, so block here.
288
                                          // >= CBR_INFO, so block here.
289
 if ( (item = (struct ackq_item_t*)list_add(&ackq, sizeof(struct ackq_item_t))) == NULL )
289
 if ( (item = (struct ackq_item_t*)ll_list_add(&ackq, sizeof(struct ackq_item_t))) == NULL )
290
 {
290
 {
291
  syslog(LOG_WARNING, "ack_q(): malloc(%d) returned NULL", sizeof(struct ackq_item_t));
291
  syslog(LOG_WARNING, "ack_q(): malloc(%d) returned NULL", sizeof(struct ackq_item_t));
292
  return(-2);
292
  return(-2);
(-)old/server/lists.c (-1 / +1 lines)
Lines 17-23 Link Here
17
 list->count = 0;
17
 list->count = 0;
18
}
18
}
19
19
20
struct list_hdr_t *list_add(struct list_anchor_t *list, int size)
20
struct list_hdr_t *ll_list_add(struct list_anchor_t *list, int size)
21
/* appends an item to the end of the list */
21
/* appends an item to the end of the list */
22
{
22
{
23
 struct list_hdr_t *item;
23
 struct list_hdr_t *item;
(-)old/server/lists.h (-1 / +1 lines)
Lines 14-20 Link Here
14
};
14
};
15
15
16
void list_init(struct list_anchor_t *list);
16
void list_init(struct list_anchor_t *list);
17
struct list_hdr_t *list_add(struct list_anchor_t *list, int size);
17
struct list_hdr_t *ll_list_add(struct list_anchor_t *list, int size);
18
void  list_del(struct list_anchor_t *list, struct list_hdr_t *item);
18
void  list_del(struct list_anchor_t *list, struct list_hdr_t *item);
19
void  list_flush(struct list_anchor_t *list);
19
void  list_flush(struct list_anchor_t *list);
20
int   list_count(struct list_anchor_t *list);
20
int   list_count(struct list_anchor_t *list);
(-)old/server/cmd_lcp3.c (-1 / +1 lines)
Lines 22-28 Link Here
22
int lcp3_cmd_queue(int cmd, struct client_t *who, void* info, int infosize)
22
int lcp3_cmd_queue(int cmd, struct client_t *who, void* info, int infosize)
23
{
23
{
24
    struct t_lcp3_ordq_item* newcmd;
24
    struct t_lcp3_ordq_item* newcmd;
25
    if ( !(newcmd = (struct t_lcp3_ordq_item*)list_add(&lcp3_ordq, sizeof(struct t_lcp3_ordq_item))) )
25
    if ( !(newcmd = (struct t_lcp3_ordq_item*)ll_list_add(&lcp3_ordq, sizeof(struct t_lcp3_ordq_item))) )
26
    {
26
    {
27
		syslog(LOG_ERR, "Out of memory. Unable to queue command.");
27
		syslog(LOG_ERR, "Out of memory. Unable to queue command.");
28
		return(-1);
28
		return(-1);
(-)old/server/proc.c (-1 / +1 lines)
Lines 92-98 Link Here
92
         return(1);
92
         return(1);
93
     }
93
     }
94
     // create a new client - record, type DC
94
     // create a new client - record, type DC
95
     if ( (who = (struct client_t*)list_add(&cltlist, sizeof(struct client_t))) == NULL )
95
     if ( (who = (struct client_t*)ll_list_add(&cltlist, sizeof(struct client_t))) == NULL )
96
     {
96
     {
97
         syslog(LOG_WARNING, "%s:%d registering error!", inet_ntoa(from->sin_addr), ntohs(from->sin_port));
97
         syslog(LOG_WARNING, "%s:%d registering error!", inet_ntoa(from->sin_addr), ntohs(from->sin_port));
98
	 cmd_direct(CMD_REG_ERROR, sock, from, NULL, 0, type);
98
	 cmd_direct(CMD_REG_ERROR, sock, from, NULL, 0, type);
(-)old/server/netinput.c (-1 / +1 lines)
Lines 77-83 Link Here
77
	struct client_t *who;
77
	struct client_t *who;
78
	newsock = accept(server->tcp_socket, (struct sockaddr*)from, &len);
78
	newsock = accept(server->tcp_socket, (struct sockaddr*)from, &len);
79
	if ( newsock == -1 ) return(-1);
79
	if ( newsock == -1 ) return(-1);
80
	who = (struct client_t*)list_add(&cltlist, sizeof(struct client_t));
80
	who = (struct client_t*)ll_list_add(&cltlist, sizeof(struct client_t));
81
	if ( !who )
81
	if ( !who )
82
	{
82
	{
83
	    syslog(LOG_ERR, "can't add new client, not enough memory");
83
	    syslog(LOG_ERR, "can't add new client, not enough memory");

Return to bug 85829