- (declare (ignore password))
- (let ((asdf::*verbose-out* (make-string-output-stream)))
- (unwind-protect
- (let* ((status (asdf:run-shell-command
- "su -c ~A createdb -h~A ~A"
- user
- (if host host "localhost")
- name))
- (result (get-output-stream-string asdf::*verbose-out*)))
-
- (if (search "database creation failed: ERROR:" result)
- (error 'clsql-access-error
- :connection-spec connection-spec
- :database-type type
- :error
- (format nil "database-create failed: ~s" result))
- t))
- (close asdf::*verbose-out*)))))
+ (declare (ignore user password))
+ (multiple-value-bind (output status)
+ (clsql-base-sys:command-output "createdb -h~A ~A"
+ (if host host "localhost")
+ name)
+ (if (or (not (zerop status))
+ (search "database creation failed: ERROR:" output))
+ (error 'clsql-access-error
+ :connection-spec connection-spec
+ :database-type type
+ :error
+ (format nil "database-create failed: ~A"
+ output))
+ t))))