DragonFly submit List (threaded) for 2007-06
DragonFly BSD
DragonFly submit List (threaded) for 2007-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: VKERNEL Pidfile patch


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Sun, 17 Jun 2007 18:49:48 +0200

Chris Turner wrote:
@@ -1039,6 +1045,24 @@
static
void
+writepid(char *path)
+{
+ pid_t self = 0;
+ FILE *pidfile = NULL;
+
+ self = getpid();
+ pidfile = fopen(path, "w");
+ if (pidfile) {

style(9) says: Test pointers against NULL, e.g., use:

(p = f()) == NULL

not:

!(p = f())

so, make this
if (pidfile != NULL)

plus, do you think the vkernel should clean up the pidfile when shutting down?

cheers
 simon

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: signature.asc
Description: OpenPGP digital signature



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