From c121349a7bbf8e9c8b30b03661836effbde2b373 Mon Sep 17 00:00:00 2001 From: Gordon Henderson Date: Tue, 15 Jan 2013 15:30:26 +0000 Subject: [PATCH] Minor changes to messages being printed from wiringPiSetup() Changed built to work marginally better. --- build | 1 + wiringPi/wiringPi.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build b/build index 740b512..9eeb4df 100755 --- a/build +++ b/build @@ -26,6 +26,7 @@ else echo echo "WiringPi library" cd wiringPi + sudo make uninstall make sudo make install echo diff --git a/wiringPi/wiringPi.c b/wiringPi/wiringPi.c index cfb6705..066f842 100644 --- a/wiringPi/wiringPi.c +++ b/wiringPi/wiringPi.c @@ -1166,7 +1166,7 @@ int wiringPiSetup (void) if (geteuid () != 0) { - fprintf (stderr, "Must be root to call wiringPiSetup(). (Did you forget sudo?)\n") ; + fprintf (stderr, "wiringPi:\n Must be root to call wiringPiSetup().\n (Did you forget sudo?)\n") ; exit (EXIT_FAILURE) ; } @@ -1203,7 +1203,8 @@ int wiringPiSetup (void) if ((fd = open ("/dev/mem", O_RDWR | O_SYNC) ) < 0) { - fprintf (stderr, "wiringPiSetup: Unable to open /dev/mem: %s\n", strerror (errno)) ; + if (wiringPiDebug) + fprintf (stderr, "wiringPiSetup: Unable to open /dev/mem: %s\n", strerror (errno)) ; return -1 ; }