Re: Shutdown BUG?



Not sure what this has to do with gnome...

> File *f;
> int res;
> f = fopen("/var/lock/Lck..File","w");
> res = fprint(f,"Locked");
> res = fclose(f);
> f = NULL;
> res = system("shutdown -h -t secs:60 now \"Error\"");

check that the open succeeded
    f = fopen("/var/lock/Lck..File","w");
    if (!f) {
	perror("/var/lock/Lck..File");
	/* e.g. permission */
	exit(1);
    }
    (voif) fprintf(f, "Locked");
    if (fclose(f) != 0) {
	perror("close(/var/lock/Lck..File) failed");
	/* e.g. not enough disk space */
	exit(1);
    }

the most likely problem is that only root can write to that file.

Lee

-- 
Liam Quin - Barefoot in Toronto - liam holoweb net - http://www.holoweb.net/
Ankh: irc.sorcery.net www.valinor.sorcery.net irc.gnome.org www.advogato.org
author, The Open Source XML Database Toolkit, Wiley, August 2000
Co-author, The XML Specification Guide, Wiley, 1999




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