conf.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1997-2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include "conf.h"
extern void logerror(char *);
static FILE *
{
int pfds[2];
/* Create a pipe and fork a child process to run the command */
logerror("failed to create pipe");
return (NULL);
}
logerror("failed to fork1");
goto err;
}
/* If we're in the child, run the command and output to the pipe */
if (pid == 0) {
/*
* We must set up to ignore these signals, which may be
* propogated from the calling process.
*/
(void) close(STDOUT_FILENO);
logerror("failed to dup to stdout");
_exit(127);
}
logerror("failed to parse configuration file");
_exit(127);
/*NOTREACHED*/
}
/* If we're in the parent, open the read end of the pipe and return */
err:
return (NULL);
}
static void
{
int status;
break;
}
}
static int
{
register char *p;
logerror("failed to allocate config file table");
return (-1);
}
for (i = 0; i < lines; i++) {
logerror("failed to allocate config file buffer");
return (-1);
}
}
return (0);
}
int
{
char *line, *p;
return (-1);
for (;;) {
/* If we need to grow the table, do so now */
goto err;
}
/* Read the next line, and break out if we're done */
break;
/* Strip newline and bump line counter */
*p = '\0';
}
return (0);
err:
return (-1);
}
void
{
}
char *
{
return (NULL);
}
void
{
int i;
}
}