Deleted Added
full compact
control.c (182352) control.c (249729)
1/*
2 * Copyright (c) 1998-2004, 2006 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sendmail.h>
12
1/*
2 * Copyright (c) 1998-2004, 2006 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
8 *
9 */
10
11#include <sendmail.h>
12
13SM_RCSID("@(#)$Id: control.c,v 8.128 2006/08/15 23:24:56 ca Exp $")
13SM_RCSID("@(#)$Id: control.c,v 8.129 2013/03/12 15:24:52 ca Exp $")
14
15#include <sm/fdset.h>
16
17/* values for cmd_code */
18#define CMDERROR 0 /* bad command */
19#define CMDRESTART 1 /* restart daemon */
20#define CMDSHUTDOWN 2 /* end daemon */
21#define CMDHELP 3 /* help */

--- 274 unchanged lines hidden (view full) ---

296
297 (void) close(sock);
298 errno = save_errno;
299 exit(EX_IOERR);
300 }
301 (void) sm_io_setvbuf(s, SM_TIME_DEFAULT, NULL,
302 SM_IO_NBF, SM_IO_BUFSIZ);
303
14
15#include <sm/fdset.h>
16
17/* values for cmd_code */
18#define CMDERROR 0 /* bad command */
19#define CMDRESTART 1 /* restart daemon */
20#define CMDSHUTDOWN 2 /* end daemon */
21#define CMDHELP 3 /* help */

--- 274 unchanged lines hidden (view full) ---

296
297 (void) close(sock);
298 errno = save_errno;
299 exit(EX_IOERR);
300 }
301 (void) sm_io_setvbuf(s, SM_TIME_DEFAULT, NULL,
302 SM_IO_NBF, SM_IO_BUFSIZ);
303
304 if (sm_io_fgets(s, SM_TIME_DEFAULT, inp, sizeof(inp)) == NULL)
304 if (sm_io_fgets(s, SM_TIME_DEFAULT, inp, sizeof(inp)) < 0)
305 {
306 (void) sm_io_close(s, SM_TIME_DEFAULT);
307 exit(EX_IOERR);
308 }
309 (void) sm_io_flush(s, SM_TIME_DEFAULT);
310
311 /* clean up end of line */
312 fixcrlf(inp, true);

--- 119 unchanged lines hidden ---
305 {
306 (void) sm_io_close(s, SM_TIME_DEFAULT);
307 exit(EX_IOERR);
308 }
309 (void) sm_io_flush(s, SM_TIME_DEFAULT);
310
311 /* clean up end of line */
312 fixcrlf(inp, true);

--- 119 unchanged lines hidden ---