1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
… | |
… | |
161 | */ |
161 | */ |
162 | void |
162 | void |
163 | init_globals () |
163 | init_globals () |
164 | { |
164 | { |
165 | if (settings.logfilename[0] == 0) |
165 | if (settings.logfilename[0] == 0) |
166 | set_logfd (-1); |
166 | log_setfd (-1); |
167 | else |
167 | else |
168 | { |
168 | { |
169 | int logfd = open (settings.logfilename, O_CREAT|O_WRONLY|O_APPEND, 0666); |
169 | int logfd = open (settings.logfilename, O_CREAT|O_WRONLY|O_APPEND, 0666); |
170 | |
170 | |
171 | if (logfd >= 0) |
171 | if (logfd >= 0) |
172 | set_logfd (logfd); |
172 | log_setfd (logfd); |
173 | else |
173 | else |
174 | { |
174 | { |
175 | set_logfd (-1); |
175 | log_setfd (-1); |
176 | LOG (llevError, "Unable to open %s as the logfile - will use stderr instead", settings.logfilename); |
176 | LOG (llevError, "Unable to open %s as the logfile - will use stderr instead", settings.logfilename); |
177 | } |
177 | } |
178 | } |
178 | } |
179 | } |
179 | } |
180 | |
180 | |