diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:11:30 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2003-09-19 23:11:30 +0000 |
commit | 96b960fca637a0765d566591885b7d42576e723f (patch) | |
tree | e6205d213aedfefacf00b4211611f436bae5e680 /contrib/sendmail/libsm/stdio.c | |
parent | ac5ff30ae19ff6f7473f23c0d36d94301124b150 (diff) | |
download | FreeBSD-src-96b960fca637a0765d566591885b7d42576e723f.zip FreeBSD-src-96b960fca637a0765d566591885b7d42576e723f.tar.gz |
Import sendmail 8.12.10
Diffstat (limited to 'contrib/sendmail/libsm/stdio.c')
-rw-r--r-- | contrib/sendmail/libsm/stdio.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/contrib/sendmail/libsm/stdio.c b/contrib/sendmail/libsm/stdio.c index d45a774..23cc2af 100644 --- a/contrib/sendmail/libsm/stdio.c +++ b/contrib/sendmail/libsm/stdio.c @@ -13,7 +13,7 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: stdio.c,v 1.56.2.10 2003/01/10 23:07:17 ca Exp $") +SM_RCSID("@(#)$Id: stdio.c,v 1.56.2.13 2003/09/04 01:18:08 ca Exp $") #include <unistd.h> #include <errno.h> #include <fcntl.h> @@ -63,7 +63,7 @@ sm_stdopen(fp, info, flags, rpool) char *path = (char *) info; int oflags; - switch (flags) + switch (SM_IO_MODE(flags)) { case SM_IO_RDWR: oflags = O_RDWR; @@ -87,6 +87,10 @@ sm_stdopen(fp, info, flags, rpool) errno = EINVAL; return -1; } +#ifdef O_BINARY + if (SM_IS_BINARY(flags)) + oflags |= O_BINARY; +#endif /* O_BINARY */ fp->f_file = open(path, oflags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (fp->f_file < 0) @@ -221,7 +225,7 @@ sm_stdsetmode(fp, mode) { int flags = 0; - switch (*mode) + switch (SM_IO_MODE(*mode)) { case SM_IO_RDWR: flags |= SMRW; @@ -402,7 +406,7 @@ sm_stdfdopen(fp, info, flags, rpool) { int oflags, tmp, fdflags, fd = *((int *) info); - switch (flags) + switch (SM_IO_MODE(flags)) { case SM_IO_RDWR: oflags = O_RDWR | O_CREAT; @@ -423,6 +427,10 @@ sm_stdfdopen(fp, info, flags, rpool) errno = EINVAL; return -1; } +#ifdef O_BINARY + if (SM_IS_BINARY(flags)) + oflags |= O_BINARY; +#endif /* O_BINARY */ /* Make sure the mode the user wants is a subset of the actual mode. */ if ((fdflags = fcntl(fd, F_GETFL, 0)) < 0) |