st/xvmc/tests: avoid non portable error.h functions
authorJonathan Gray <jsg@jsg.id.au>
Thu, 11 Jul 2013 07:52:00 +0000 (09:52 +0200)
committerChristian König <christian.koenig@amd.com>
Thu, 11 Jul 2013 07:52:00 +0000 (09:52 +0200)
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Christian König <christian.koenig@amd.com>
src/gallium/state_trackers/xvmc/tests/xvmc_bench.c

index fe8580219363501b94f3b5e7bdf44264f2152c3b..37360a656b620a6477d2db088c2743100af30d9c 100644 (file)
@@ -28,7 +28,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
-#include <error.h>
+#include <stdlib.h>
 #include <sys/time.h>
 #include "testlib.h"
 
@@ -144,9 +144,9 @@ void ParseArgs(int argc, char **argv, struct Config *config)
        }
 
        if (fail)
-               error
-               (
-                       1, 0,
+       {
+               fprintf(
+                       stderr,
                        "Bad argument.\n"
                        "\n"
                        "Usage: %s [options]\n"
@@ -161,6 +161,8 @@ void ParseArgs(int argc, char **argv, struct Config *config)
                        "\tMB types: i,p,b\n",
                        argv[0]
                );
+               exit(1);
+       }
 
        if (config->output_width == 0)
                config->output_width = config->input_width;
@@ -214,7 +216,8 @@ int main(int argc, char **argv)
        ))
        {
                XCloseDisplay(display);
-               error(1, 0, "Error, unable to find a good port.\n");
+               fprintf(stderr, "Error, unable to find a good port.\n");
+               exit(1);
        }
 
        if (is_overlay)