Changeset 1228

Show
Ignore:
Timestamp:
09/02/05 04:40:28 (3 years ago)
Author:
darcs
Message:

alternc-mailman: changeset Fix mailman wrappers
Build them with "-Wall -Werror" flags. Fix a potential segfault in
mailman.sub. Small clean-ups.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile

    r1210 r1228  
    2727# 
    2828CC=gcc 
     29CFLAGS=-Wall -Werror 
    2930PROGS=mailman.create mailman.delete mailman.list mailman.sub mailman.unsub 
    3031 
    3132all: ${PROGS} 
    32  
    33 %: %.c 
    34         $(CC) $< -o $@ 
    3533 
    3634clean:  
  • trunk/src/mailman.create.c

    r1209 r1228  
    3030#include <sys/types.h> 
    3131#include <unistd.h> 
     32#include <stdlib.h> 
    3233/* printf() perror() */ 
    3334#include <stdio.h> 
     
    5051   
    5152  perror("exec failed"); 
     53 
     54  return 0; 
    5255} 
  • trunk/src/mailman.delete.c

    r1209 r1228  
    3939  if (argc!=2) { 
    4040    printf("Utilisation : mailman.delete <list-name>\n\n"); 
    41     exit(-1)
     41    return -1
    4242  } 
    4343   
     
    4949 
    5050  perror("exec failed"); 
     51 
     52  return 0; 
    5153} 
  • trunk/src/mailman.list.c

    r1209 r1228  
    3939  if (argc!=2) { 
    4040    printf("Utilisation : mailman.list <list> \n\n"); 
    41     exit(-1)
     41    return -1
    4242  } 
    4343   
     
    4949 
    5050  perror("execl failed"); 
     51 
     52  return 0; 
    5153} 
  • trunk/src/mailman.sub.c

    r1210 r1228  
    3838  if (argc!=2) { 
    3939    printf("Utilisation : echo <user> | mailman.sub <list>\n\n"); 
    40     exit(-1)
     40    return -1
    4141  } 
    4242   
     
    4545 
    4646  // WARNING : LIST ZONE // 
    47   execl(M_PATH, M_PATH, "-r", "-", "-w", "n", argv[1], argv[2], 0); 
     47  execl(M_PATH, M_PATH, "-r", "-", "-w", "n", argv[1], 0); 
    4848 
    4949  perror("exec failed"); 
     50 
     51  return 0; 
    5052} 
  • trunk/src/mailman.unsub.c

    r1210 r1228  
    3838  if (argc!=3) { 
    3939    printf("Utilisation : mailman.unsub <list> <email>\n\n"); 
    40     exit(-1)
     40    return -1
    4141  } 
    4242   
     
    4848  perror("exec failed"); 
    4949 
     50  return 0; 
    5051}