Always display sudo error message

This commit is contained in:
F5OEO 2019-01-07 14:12:10 +00:00
parent 774ee36f16
commit 288ff2299c

View file

@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/sysmacros.h>
#include "mailbox.h" #include "mailbox.h"
#include "util.h" #include "util.h"
@ -49,7 +49,7 @@ void *mapmem(unsigned base, unsigned size)
base = base - offset; base = base - offset;
/* open /dev/mem */ /* open /dev/mem */
if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) { if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {
dbg_printf(1,"can't open /dev/mem\nThis program should be run as root. Try prefixing command with: sudo\n"); dbg_printf(0,"can't open /dev/mem\nThis program should be run as root. Try prefixing command with: sudo\n");
exit (-1); exit (-1);
} }
void *mem = mmap( void *mem = mmap(