Deleted Added
full compact
flags.c (98121) flags.c (120256)
1/*
1/*
2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
2 * Copyright (c) 2000-2001, 2003 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Chris Torek.
9 *
10 * By using this file, you agree to the terms and conditions set
11 * forth in the LICENSE file which can be found at the top level of
12 * the sendmail distribution.
13 */
14
15#include <sm/gen.h>
3 * All rights reserved.
4 * Copyright (c) 1990, 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Chris Torek.
9 *
10 * By using this file, you agree to the terms and conditions set
11 * forth in the LICENSE file which can be found at the top level of
12 * the sendmail distribution.
13 */
14
15#include <sm/gen.h>
16SM_RCSID("@(#)$Id: flags.c,v 1.20 2001/09/11 04:04:48 gshapiro Exp $")
16SM_RCSID("@(#)$Id: flags.c,v 1.20.2.1 2003/09/03 18:51:56 ca Exp $")
17#include <sys/types.h>
18#include <sys/file.h>
19#include <errno.h>
20#include <sm/io.h>
21
22/*
23** SM_FLAGS -- translate external (user) flags into internal flags
24**

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

30*/
31
32int
33sm_flags(flags)
34 register int flags;
35{
36 register int ret;
37
17#include <sys/types.h>
18#include <sys/file.h>
19#include <errno.h>
20#include <sm/io.h>
21
22/*
23** SM_FLAGS -- translate external (user) flags into internal flags
24**

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

30*/
31
32int
33sm_flags(flags)
34 register int flags;
35{
36 register int ret;
37
38 switch(flags)
38 switch(SM_IO_MODE(flags))
39 {
40 case SM_IO_RDONLY: /* open for reading */
41 ret = SMRD;
42 break;
43
44 case SM_IO_WRONLY: /* open for writing */
45 ret = SMWR;
46 break;

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

52 case SM_IO_RDWR: /* open for read and write */
53 ret = SMRW;
54 break;
55
56 default:
57 ret = 0;
58 break;
59 }
39 {
40 case SM_IO_RDONLY: /* open for reading */
41 ret = SMRD;
42 break;
43
44 case SM_IO_WRONLY: /* open for writing */
45 ret = SMWR;
46 break;

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

52 case SM_IO_RDWR: /* open for read and write */
53 ret = SMRW;
54 break;
55
56 default:
57 ret = 0;
58 break;
59 }
60 if (SM_IS_BINARY(flags))
61 ret |= SM_IO_BINARY;
60 return ret;
61}
62 return ret;
63}