Christian Stimming (stimm...@tuhh.de) said: > Can someone explain to me the intention of the following code that > initialiizes the trace file output file descriptor (from > src/libqof/qof/qoflog.c:157ff) > > fname = g_strconcat(log_filename, ".XXXXXX", NULL); > if ((fd = g_mkstemp(fname)) != -1) > { > g_rename(fname, log_filename); > fout = fdopen(fd, "w"); > } > > where log_filename=="/tmp/gnucash.trace", so that fname will be > something like "/tmp/gnucash.trace.KSHDJS". From reading the code, I > guess it should mean "Open gnucash.trace.KSHDJS as trace file and > immediately after opening it, rename it back into gnucash.trace". > That's at least what the introduction of this code in > http://svn.gnucash.org/trac/changeset/15435 suggests.
That's what's intended, yes. And it works for me. ... 12566 open("/home/notting/tmp/gnucash.trace.RNY78U", O_RDWR|O_CREAT|O_EXCL, 0600) = 3 12566 rename("/home/notting/tmp/gnucash.trace.RNY78U", "/home/notting/tmp/gnucash.trace") = 0 ... Bill _______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel