From bfdce4d192a946521d54079cf15b9da79ab1316e Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 7 Apr 2009 16:04:28 +0200 Subject: remove now unused util.[ch] --- src/Makefile.am | 6 ++---- src/util.c | 61 --------------------------------------------------------- src/util.h | 23 ---------------------- 3 files changed, 2 insertions(+), 88 deletions(-) delete mode 100644 src/util.c delete mode 100644 src/util.h diff --git a/src/Makefile.am b/src/Makefile.am index 5686c2b..a9fe688 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,8 +2,6 @@ bin_PROGRAMS = gipfel gipfel_SOURCES = \ gipfel.cxx \ - util.c \ - strsep.c \ GipfelWidget.cxx \ Panorama.cxx \ ProjectionLSQ.cxx \ @@ -19,7 +17,8 @@ gipfel_SOURCES = \ TIFFOutputImage.cxx \ PreviewOutputImage.cxx \ ImageMetaData.cxx \ - ScreenDump.cxx + ScreenDump.cxx \ + strsep.c noinst_HEADERS = \ GipfelWidget.H \ @@ -41,5 +40,4 @@ noinst_HEADERS = \ PreviewOutputImage.H \ ImageMetaData.H \ ScreenDump.H \ - util.h \ strsep.h diff --git a/src/util.c b/src/util.c deleted file mode 100644 index 885538f..0000000 --- a/src/util.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Copyright 2007 Johannes Hofmann - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - */ - -#include -#include -#include - -#include "util.h" - -FILE * -pexecvp(const char *file, char *const argv[], pid_t *pid, char *type) { - FILE *iop; - int pdes[2]; - - if (pipe(pdes) < 0) { - return NULL; - } - - *pid = fork(); - - if (*pid == -1) { - perror("vfork"); - close(pdes[0]); - close(pdes[1]); - return NULL; - } else if (*pid == 0) { - /* child */ - - if (*type == 'r') { - close(pdes[0]); - if (pdes[1] != STDOUT_FILENO) { - dup2(pdes[1], STDOUT_FILENO); - close(pdes[1]); - } - } else { - close(pdes[1]); - if (pdes[0] != STDIN_FILENO) { - dup2(pdes[0], STDIN_FILENO); - close(pdes[0]); - } - } - - execvp(file, argv); - _exit(127); - } else { - /* parent */ - if (*type == 'r') { - iop = fdopen(pdes[0], "r"); - close(pdes[1]); - } else { - iop = fdopen(pdes[1], "w"); - close(pdes[0]); - } - return iop; - } -} diff --git a/src/util.h b/src/util.h deleted file mode 100644 index f30047e..0000000 --- a/src/util.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2006 Johannes Hofmann - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - */ -#ifndef _UTIL_H_ -#define _UTIL_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - - FILE * - pexecvp(const char *file, char *const argv[], pid_t *pid, char *type); - -#ifdef __cplusplus -} -#endif - -#endif -- cgit v1.2.3