Re: Strange behaviour with printf vs. g_print (Repost)



Peter \"Firefly\" Lund wrote:

On Tue, 20 Aug 2002, Tristan Van Berkom wrote:

library and call a function that will use one of the g_print routines
.... the
application's standard printf fprintf etc functions won't work.

      this is strange because if I do something like this:

void main() {
      while (1) {
              g_print("gprint\n");
              printf("printf\n");
              g_warning("g_warning");
              g_message("g_message");
              fprintf(stderr, "fprintf\n");
      }
}

The standard printf functions still work.

Do you have a flushing problem, perhaps?

(see if something like fflush(stdout) placed strategically will change the
output)

-Peter

That was one of the first things I checked out;
its as if stdout->_fileno was closed or redirected or
I lost connection with my terminal.

The application is a daemon but thats just

fork(); twice
setsid(0);
and 
close(stdin->_fileno);

but the problem could also be with the usage of libmysqlclient
(which involves alot of text streaming to and from the "mysqld")

        -Tristan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]