I've turned my service into a daemon and am observing strange behaviour. While it was just a console application, I used printf for output:
Now I have to open the system console — /dev/console — and write into it.
The output goes to the ttyv0 terminal. If I'm logged in on that terminal, everything is fine. But once I log out - exit - the output continues without carriage returns. I can, of course, add a carriage return explicitly:
But they say you do not need that in UNIX. What's the matter? Where can I read about this?
Code:
printf("Bla bla bla\n");
Now I have to open the system console — /dev/console — and write into it.
Code:
fCon = fopen("/dev/console", "w");
fprintf(fCon, "Bla bla bla\n");
The output goes to the ttyv0 terminal. If I'm logged in on that terminal, everything is fine. But once I log out - exit - the output continues without carriage returns. I can, of course, add a carriage return explicitly:
Code:
fprintf(fCon, "Bla bla bla\r\n");
But they say you do not need that in UNIX. What's the matter? Where can I read about this?