summaryrefslogtreecommitdiff
path: root/wrapper/rvs.h
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2009-09-14 22:19:48 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-06-26 00:30:15 -0600
commit1eddff249b2c7ce54544b840562e782501d47924 (patch)
tree2c2f728872a8c8dc8a9e013bc0afac5379eb29e1 /wrapper/rvs.h
parent1aae71a1c7365d56aa6b0549bde6e8af07513f5f (diff)
well, launching plugins is written, too bad it segfaults
Diffstat (limited to 'wrapper/rvs.h')
-rw-r--r--wrapper/rvs.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/wrapper/rvs.h b/wrapper/rvs.h
index 83cde87..57358f2 100644
--- a/wrapper/rvs.h
+++ b/wrapper/rvs.h
@@ -66,14 +66,28 @@ xfree (void *ptr)
free (ptr);
}
+void
+xsystem (const char *command)
+{
+ int stat=system(command);
+ if (stat!=0) {
+ if (stat==-1) {
+ fprintf(stderr,
+ "%s: unable to launch run command",
+ program_invocation_name);
+ exit(EXIT_FAILURE);
+ } else
+ exit(EXIT_FAILURE);
+ }
+}
+
/* unistd.h */
int
xchdir (const char *filename)
{
int ret=chdir(filename);
- if (ret != 0) {
+ if (ret != 0)
error(EXIT_FAILURE,errno,"%s/",filename);
- }
return ret;
}
@@ -83,10 +97,8 @@ xfopen (const char *filename, const char *opentype)
{
FILE *file = fopen(filename,opentype);
/* fopen gives NULL on failure */
- if ( file == NULL ) {
+ if ( file == NULL )
error(EXIT_FAILURE,errno,"%s",filename);
- }
-
return file;
}