[multipathd] remove copy.[ch]
authorroot <root@xa-s05.(none)>
Thu, 21 Jul 2005 06:34:06 +0000 (08:34 +0200)
committerroot <root@xa-s05.(none)>
Thu, 21 Jul 2005 06:34:06 +0000 (08:34 +0200)
The only user was prepare_namespace(), gone.

multipathd/Makefile
multipathd/copy.c [deleted file]
multipathd/copy.h [deleted file]
multipathd/main.c

index 22b125a..a42b459 100644 (file)
@@ -26,7 +26,7 @@ LDFLAGS = -lpthread -ldevmapper -lsysfs -lreadline -lcurses
 #
 # object files
 #
-OBJS = main.o copy.o log.o log_pthread.o pidfile.o uxlsnr.o uxclnt.o cli.o cli_handlers.o \
+OBJS = main.o log.o log_pthread.o pidfile.o uxlsnr.o uxclnt.o cli.o cli_handlers.o \
        $(MULTIPATHLIB)-glibc.a $(CHECKERSLIB)-glibc.a \
 
 
diff --git a/multipathd/copy.c b/multipathd/copy.c
deleted file mode 100644 (file)
index 9a8cc70..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <util.h>
-
-#include "debug.h"
-
-#define FILESIZE 128
-
-int
-copy (char * src, char * dst)
-{
-       int fdin;
-       int fdout;
-       char * mmsrc;
-       char * mmdst;
-       struct stat statbuf;
-
-       fdin = open (src, O_RDONLY);
-
-       if (fdin < 0) {
-               condlog(0, "[copy.c] cannot open %s", src);
-               return -1;
-       }
-       /*
-        * Stat the input file to obtain its size
-        */
-       if (fstat (fdin, &statbuf) < 0) {
-               condlog(0, "[copy.c] cannot stat %s", src);
-               goto out1;
-       }
-       /*
-        * Open the output file for writing,
-        * with the same permissions as the source file
-        */
-       fdout = open (dst, O_RDWR | O_CREAT | O_TRUNC, statbuf.st_mode);
-
-       if (fdout < 0) {
-               condlog(0, "[copy.c] cannot open %s", dst);
-               goto out1;
-       }
-
-       if (lseek (fdout, statbuf.st_size - 1, SEEK_SET) == -1) {
-               condlog(0, "[copy.c] cannot lseek %s", dst);
-               goto out2;
-       }
-
-       if (write (fdout, "", 1) != 1) {
-               condlog(0, "[copy.c] cannot write dummy char");
-               goto out2;
-       }
-       /*
-        * Blast the bytes from one file to the other
-        */
-       if ((mmsrc = mmap(0, statbuf.st_size, PROT_READ, MAP_SHARED, fdin, 0))
-               == (caddr_t) -1) {
-               condlog(0, "[copy.c] cannot mmap %s", src);
-               goto out2;
-       }
-       
-       if ((mmdst = mmap(0, statbuf.st_size, PROT_READ | PROT_WRITE,
-               MAP_SHARED, fdout, 0)) == (caddr_t) -1) {
-               condlog(0, "[copy.c] cannot mmap %s", dst);
-               goto out3;
-       }
-       memcpy(mmdst, mmsrc, statbuf.st_size);
-
-/* done */
-       munmap(mmdst, statbuf.st_size);
-out3:
-       munmap(mmsrc, statbuf.st_size);
-out2:
-       close (fdout);
-out1:
-       close (fdin);
-
-       return 0;
-}
-
-int
-copytodir (char * src, char * dstdir)
-{
-       char dst[FILESIZE];
-       char filename[FILESIZE];
-       
-       basename(src, filename);
-       if (FILESIZE <= snprintf(dst, FILESIZE, "%s/%s", dstdir, filename)) {
-               condlog(0, "[copy.c] filename buffer overflow : %s ", filename);
-               return -1;
-       }
-
-       return copy(src, dst);
-}
diff --git a/multipathd/copy.h b/multipathd/copy.h
deleted file mode 100644 (file)
index 999391f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _COPY_H
-#define _COPY_H
-
-int copytodir (char *, char *);
-
-#endif /* _COPY_H */
index cd33d03..3d531ae 100644 (file)
@@ -51,7 +51,6 @@
 #include <path_state.h>
 
 #include "main.h"
-#include "copy.h"
 #include "pidfile.h"
 #include "uxlsnr.h"
 #include "uxclnt.h"