From 5e269e33fffbd14baa1a0761236ee62c4a97593e Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sun, 21 Jan 2018 14:14:09 +0100 Subject: [PATCH] Move "system" into chicken.process (posix.scm) We already have system* in there, and it exports both, so it only makes sense to move the definition from library.scm here too. --- chicken-uninstall.scm | 1 + chicken.import.scm | 2 +- library.scm | 8 -------- posix.scm | 7 +++++++ types.db | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chicken-uninstall.scm b/chicken-uninstall.scm index bb4e7852..b7a7d3cc 100644 --- a/chicken-uninstall.scm +++ b/chicken-uninstall.scm @@ -35,6 +35,7 @@ (chicken irregex) (chicken port) (chicken pathname) + (chicken process) (chicken process-context) (chicken string)) diff --git a/chicken.import.scm b/chicken.import.scm index 24bc00a8..d0908e29 100644 --- a/chicken.import.scm +++ b/chicken.import.scm @@ -155,7 +155,7 @@ (symbol-append . chicken.base#symbol-append) symbol-escape (syntax-error . chicken.syntax#syntax-error) - system + (system . chicken.process#system) (unregister-feature! . chicken.platform#unregister-feature!) (vector-copy! . chicken.base#vector-copy!) (vector-resize . chicken.base#vector-resize) diff --git a/library.scm b/library.scm index 992fdb9d..a8b2f184 100644 --- a/library.scm +++ b/library.scm @@ -1212,14 +1212,6 @@ EOF (lp val forward))))) obj))) -(define (system cmd) - (##sys#check-string cmd 'system) - (let ((r (##core#inline "C_execute_shell_command" cmd))) - (cond ((fx< r 0) - (##sys#update-errno) - (##sys#signal-hook #:process-error 'system "`system' invocation failed" cmd) ) - (else r) ) ) ) - ;;; Dynamic Load diff --git a/posix.scm b/posix.scm index fdd97dbb..fcb6efec 100644 --- a/posix.scm +++ b/posix.scm @@ -179,6 +179,13 @@ (import chicken scheme chicken.posix chicken.platform) +(define (system cmd) + (##sys#check-string cmd 'system) + (let ((r (##core#inline "C_execute_shell_command" cmd))) + (cond ((fx< r 0) + (##sys#update-errno) + (##sys#signal-hook #:process-error 'system "`system' invocation failed" cmd) ) + (else r) ) ) ) ;;; Like `system', but bombs on nonzero return code: diff --git a/types.db b/types.db index 298c4e97..b65647e1 100644 --- a/types.db +++ b/types.db @@ -1402,7 +1402,6 @@ (symbol-escape (#(procedure #:clean) symbol-escape (#!optional *) *)) -(system (#(procedure #:clean #:enforce) system (string) fixnum)) (##sys#void (#(procedure #:pure) void (#!rest) undefined)) ;; chicken (internal) @@ -2099,6 +2098,7 @@ ;; process +(chicken.process#system (#(procedure #:clean #:enforce) chicken.process#system (string) fixnum)) (chicken.process#system* (#(procedure #:clean #:enforce) chicken.process#system* (string #!rest) undefined)) (chicken.process#qs (#(procedure #:clean #:enforce) chicken.process#qs (string) string)) -- 2.11.0