• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

oga's tools


Commit MetaInfo

Revision7ba6498104d8be2430baad87c7be09bedad04643 (tree)
Zeit2014-02-22 01:28:16
Autoroga <hyperoga@gmai...>
Commiteroga

Log Message

2014/02/22 V1.03 support MinGW

Ändern Zusammenfassung

Diff

--- a/shutdown.c
+++ b/shutdown.c
@@ -4,14 +4,15 @@
44 // 2001/10/17 V1.00 by oga.
55 // 2007/04/19 V1.01 support suspend
66 // 2009/12/17 V1.02 fix ExitWindowsEx() error log
7+// 2014/02/22 V1.03 support MinGW
78 //
89 #include <windows.h>
910 #include <stdio.h>
1011 #include <powrprof.h>
1112
1213 // globals
13-char *VER = "1.02";
14-int logf = 0; // -log option
14+char *VER = "1.03";
15+int logff = 0; // -log option
1516 char *logfile = NULL; // log file name
1617 FILE *fp = NULL;
1718
@@ -36,11 +37,11 @@ void usage()
3637 int outlog(char *msg)
3738 {
3839 SYSTEMTIME syst;
39- if (logf) {
40+ if (logff) {
4041 if (fp == NULL) {
4142 if ((fp = fopen(logfile, "a")) == NULL) {
4243 perror("Error: fopen()");
43- logf = 0;
44+ logff = 0;
4445 }
4546 }
4647 GetLocalTime(&syst);
@@ -170,7 +171,7 @@ int main(int a, char *b[])
170171 /* V1.01-A end */
171172 if (!strcmp(b[i], "-log")) {
172173 if (++i < a) {
173- logf = 1;
174+ logff = 1;
174175 logfile = b[i];
175176 continue;
176177 } else {
@@ -288,7 +289,7 @@ int main(int a, char *b[])
288289 }
289290
290291 if (fp) fclose(fp); // close logfile
291- logf = 0;
292+ logff = 0;
292293 if (!ExitWindowsEx(shutopt, 0)) {
293294 char *msgbuf;
294295 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |