1/*
| 1/*
|
2 * Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
| 2 * Copyright (c) 2000-2002 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#include <sm/gen.h>
| 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#include <sm/gen.h>
|
11SM_IDSTR(id, "@(#)$Id: t-fopen.c,v 1.8 2001/09/11 04:04:49 gshapiro Exp $")
| 11SM_IDSTR(id, "@(#)$Id: t-fopen.c,v 1.9 2002/02/06 23:57:45 ca Exp $")
|
12 13#include <fcntl.h> 14#include <sm/io.h> 15#include <sm/test.h> 16 17/* ARGSUSED0 */ 18int 19main(argc, argv) 20 int argc; 21 char *argv[]; 22{
| 12 13#include <fcntl.h> 14#include <sm/io.h> 15#include <sm/test.h> 16 17/* ARGSUSED0 */ 18int 19main(argc, argv) 20 int argc; 21 char *argv[]; 22{
|
| 23 int m, r;
|
23 SM_FILE_T *out; 24 25 sm_test_begin(argc, argv, "test sm_io_fopen"); 26 out = sm_io_fopen("foo", O_WRONLY|O_APPEND|O_CREAT, 0666); 27 SM_TEST(out != NULL); 28 if (out != NULL) 29 { 30 (void) sm_io_fprintf(out, SM_TIME_DEFAULT, "foo\n");
| 24 SM_FILE_T *out; 25 26 sm_test_begin(argc, argv, "test sm_io_fopen"); 27 out = sm_io_fopen("foo", O_WRONLY|O_APPEND|O_CREAT, 0666); 28 SM_TEST(out != NULL); 29 if (out != NULL) 30 { 31 (void) sm_io_fprintf(out, SM_TIME_DEFAULT, "foo\n");
|
| 32 r = sm_io_getinfo(out, SM_IO_WHAT_MODE, &m); 33 SM_TEST(r == 0); 34 SM_TEST(m == SM_IO_WRONLY);
|
31 sm_io_close(out, SM_TIME_DEFAULT); 32 } 33 return sm_test_end(); 34}
| 35 sm_io_close(out, SM_TIME_DEFAULT); 36 } 37 return sm_test_end(); 38}
|