intel-iot-devkit/mraa — pull request #71 by alext-mkrs (2014-12-15 22:03:56+00:00)
Title: Increased verbosity and added user check into mraa_init()

Here comes my first take at it, your comments are highly appreciated.

mraa_init() now will:
- print user name and EUID of the process instead of UID,
- print full platform text name in addition to numeric type,
- return, log and print an error if started by non-root user

This fixes #64.

**Example of `mraa-helloworld` when run as root.**
*syslog:*
```
Dec 15 21:57:09 edison1 libmraa[488]: libmraa initialised by user 'root' with EUID 0
Dec 15 21:57:09 edison1 libmraa[488]: libmraa initialised for platform 'Intel Edison' of type 2
```
*console:*
```
root@edison1:~# /home/root/mraa-test
hello mraa
Version: v0.5.4-33-gae8a563
Running on Intel Edison
```

**Example when run as non-root.**
*syslog:*
```
Dec 15 21:56:53 edison1 libmraa[487]: libmraa initialised by user 'daemon' with EUID 1
Dec 15 21:56:53 edison1 libmraa[487]: mraa: FATAL error, libmraa program must be run as root (EUID 0), cannot proceed
```
*console:*
```
root@edison1:~# su daemon -c /home/root/mraa-test
mraa: FATAL error, libmraa program must be run as root (EUID 0), cannot proceed
hello mraa
Version: v0.5.4-33-gae8a563
Running on Unknown
```