File: log.c

package info (click to toggle)
hztty 2.0-5.2woody2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,028 kB
  • ctags: 295
  • sloc: ansic: 26,960; makefile: 162; sh: 109
file content (32 lines) | stat: -rw-r--r-- 489 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* $Id: log.c,v 2.0 1995/01/29 08:10:04 ygz Exp $ */

#ifndef lint
static char *rcs_id="$Id: log.c,v 2.0 1995/01/29 08:10:04 ygz Exp $";
#endif /* lint */

#include "config.h"
#include "io.h"

char *io_log (s,plen,inst)
     char *s;
     int *plen;
     int inst;
{
	write(inst, s, *plen);
        return (s);
}

int log_init (arg)
     char *arg;
{
  int f = open(arg, O_WRONLY | O_CREAT | O_TRUNC, 0644);

        if (f < 0) {
	        perror (arg);
		return (-1);
	}
	return (f);
}