For the second link this seemed possibly relevant even if you get past the compiling error:

USB, Serial and Reset with the Leonardo under Linux (RPi)The Arduino Leonardo uses a different solution for USB and serial. Please, first read this and this.

That said, Leonardo does NOT reset when a serial connection is established, regardless if the DTR line is used or not. This is very good if auto-reset is non desired. But how to reset Leonardo via serial?. The documentation sais you must open the serial port with 1200baud and then close. Here are two python programs, one for reading serial and the other one for reset. Both are tested on a Raspberry Pi.

Currently MRL depends on the reset .. which I think we should change, so that it doesn't rely on this "inconsistent" behavior of Arduino