[50962] trunk/base/src/pextlib1.0

toby at macports.org toby at macports.org
Wed May 13 23:34:38 PDT 2009


Revision: 50962
          http://trac.macports.org/changeset/50962
Author:   toby at macports.org
Date:     2009-05-13 23:34:38 -0700 (Wed, 13 May 2009)
Log Message:
-----------
remove mkfifo, also unused
also fix test target

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/Makefile
    trunk/base/src/pextlib1.0/Pextlib.c

Removed Paths:
-------------
    trunk/base/src/pextlib1.0/tests/fifo.tcl

Modified: trunk/base/src/pextlib1.0/Makefile
===================================================================
--- trunk/base/src/pextlib1.0/Makefile	2009-05-14 06:30:30 UTC (rev 50961)
+++ trunk/base/src/pextlib1.0/Makefile	2009-05-14 06:34:38 UTC (rev 50962)
@@ -17,9 +17,9 @@
 .PHONY: test
 
 test:: ${SHLIB_NAME}
+	${TCLSH} tests/checksums.tcl ${SHLIB_NAME}
 	${TCLSH} tests/curl.tcl ${SHLIB_NAME}
-	${TCLSH} tests/checksums.tcl ${SHLIB_NAME}
 	${TCLSH} tests/filemap.tcl ${SHLIB_NAME}
-	${TCLSH} tests/fifo.tcl ${SHLIB_NAME}
 	${TCLSH} tests/fs-traverse.tcl ${SHLIB_NAME}
-	${TCLSH} tests/socketpair.tcl ${SHLIB_NAME}
+	${TCLSH} tests/symlink.tcl ${SHLIB_NAME}
+	${TCLSH} tests/unsetenv.tcl ${SHLIB_NAME}

Modified: trunk/base/src/pextlib1.0/Pextlib.c
===================================================================
--- trunk/base/src/pextlib1.0/Pextlib.c	2009-05-14 06:30:30 UTC (rev 50961)
+++ trunk/base/src/pextlib1.0/Pextlib.c	2009-05-14 06:34:38 UTC (rev 50962)
@@ -809,54 +809,6 @@
 	return TCL_OK;
 }
 
-/**
- * Call mkfifo(2).
- * Generate a Tcl error if something wrong occurred.
- *
- * Syntax is:
- * mkfifo path mode
- */
-int MkfifoCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
-{
-	char* path;
-	mode_t mode;
-
-	if (objc != 3) {
-		Tcl_WrongNumArgs(interp, 1, objv, "path mode");
-		return TCL_ERROR;
-	}
-	
-	{
-		char* mode_as_char_star;
-		int mode_as_int;
-		mode_as_char_star = strdup(Tcl_GetString(objv[2]));
-		if (mode_as_char_star == NULL) {
-			return TCL_ERROR;
-		}
-
-		if (Tcl_GetInt(interp, mode_as_char_star, &mode_as_int) != TCL_OK) {
-			free(mode_as_char_star);
-			return TCL_ERROR;
-		}
-		free(mode_as_char_star);
-		mode = (mode_t) mode_as_int;
-	}
-
-	path = strdup(Tcl_GetString(objv[1]));
-	if (path == NULL) {
-		return TCL_ERROR;
-	}
-
-	if (mkfifo(path, mode) != 0) {
-		Tcl_AppendResult(interp, "mkfifo failed: ", strerror(errno), NULL);
-		free(path);
-		return TCL_ERROR;
-	}
-
-	free(path);
-	return TCL_OK;
-}
-
 int ExistsuserCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	Tcl_Obj *tcl_result;
@@ -1195,7 +1147,6 @@
 	Tcl_CreateObjCommand(interp, "sha1", SHA1Cmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "umask", UmaskCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "sudo", SudoCmd, NULL, NULL);
-	Tcl_CreateObjCommand(interp, "mkfifo", MkfifoCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "pipe", PipeCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "curl", CurlCmd, NULL, NULL);
 	Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);

Deleted: trunk/base/src/pextlib1.0/tests/fifo.tcl
===================================================================
--- trunk/base/src/pextlib1.0/tests/fifo.tcl	2009-05-14 06:30:30 UTC (rev 50961)
+++ trunk/base/src/pextlib1.0/tests/fifo.tcl	2009-05-14 06:34:38 UTC (rev 50962)
@@ -1,39 +0,0 @@
-# Test file for Pextlib's mkfifo.
-# Requires r/w access to /tmp/
-# Syntax:
-# tclsh mkfifo.tcl <Pextlib name>
-
-proc main {pextlibname} {
-	load $pextlibname
-	
-	set fifo_path "/tmp/macports-pextlib-fifo"
-	
-	file delete -force $fifo_path
-
-	# Create the named pipe.
-	mkfifo $fifo_path 0700
-	
-	# Check it exists.
-	if {![file exists $fifo_path]} {
-		puts {![file exists $fifo_path]}
-		exit 1
-	}
-
-	# Check it's a fifo.
-	if {[file type $fifo_path] != "fifo"} {
-		puts {[file type $fifo_path] != "fifo"}
-		exit 1
-	}
-
-	file delete -force $fifo_path
-	
-	set fifo_path "/tmp/macports-pextlib-fifo-dummydir/foo"
-
-	# Test that mkfifo returns an error if the directory doesn't exist.
-	if {![catch {mkfifo $fifo_path}]} {
-		puts {![catch {mkfifo $fifo_path}]}
-		exit 1
-	}
-}
-
-main $argv
\ No newline at end of file
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090513/6fc45cdc/attachment.html>


More information about the macports-changes mailing list