云上的老鼠

云上的日子

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  76篇文章 :: 0篇收藏:: 61篇评论:: 0个Trackbacks

公告

这是quickmouse的blog哟

^______^

文章的转载请保留全文以及注明出处,谢谢合作!

文章

收藏

相册

常用链接

我的联系方式

友情推荐

主人推荐

存档


正在读取评论……


by Jerry.Zhong <quickmouse@263.net>

Filename: utmp.c
Function: write_utmp
Description:
    Let's look at the segment of write_utmp dealing with writing delayed boot record.  It depends on variable wrote_utmp_reboot. This variable will NOT be zero when UTMP_FILE is exist, but that does NOT mean a write process can be successful, for example the filesystem is in readonly states.

120:        if (access(UTMP_FILE, F_OK) < 0)
121:                return;
122:
123:#ifdef INIT_MAIN
124:        /*
125:         *        Note if we are going to write a boot record.
126:         */
127:        if (type == BOOT_TIME) wrote_utmp_reboot++;
128:
129:        /*
130:         *        See if we need to write a reboot record. The reason that
131:         *        we are being so paranoid is that when we first tried to
132:         *        write the reboot record, /var was possibly not mounted
133:         *        yet. As soon as we can open WTMP we write a delayed boot record.
134:         */
135:        if (wrote_utmp_reboot == 0 && type != BOOT_TIME)
136:                  write_utmp("reboot", "~~", 0, BOOT_TIME, "~", NULL);
137:#endif

    Please compare this segment to write_wtmp function. It uses a file open function to check whether the write can be processed.



Trackback: http://tb.donews.net/TrackBack.aspx?PostId=1039379


[点击此处收藏本文]  发表于2006年09月16日 6:33 PM




正在读取评论……

发表评论

大名:
网址:
验证码
评论