VKERNEL Pidfile patch

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Sun Jun 17 09:50:01 PDT 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00001.pgp
Type: application/octet-stream
Size: 252 bytes
Desc: "Description: OpenPGP digital signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20070617/4d1159b4/attachment-0019.obj>


More information about the Submit mailing list