Always display sudo error message
This commit is contained in:
parent
774ee36f16
commit
288ff2299c
1 changed files with 2 additions and 2 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue