Re: [patch] File locking
- From: Morten Welinder <terra diku dk>
- To: floris snow nl
- Cc: gnumeric-list gnome org
- Subject: Re: [patch] File locking
- Date: 3 Jul 2002 16:19:29 -0000
+ char lockstr[300];
+ char hostname[256];
+ /* Create the locking string, format is
+ * hostname:pid */
+ gethostname(hostname, 255);
+ snprintf(lockstr, 300, "%s:%d", hostname, getpid());
No, array[constant], please. Use dynamically allocated strings
instead. Also, getpid returns a pid_t, not an int, so it does not
match "%d".
Thanks,
Morten
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]