ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libptytty/ptytty.m4
(Generate patch)

Comparing libptytty/ptytty.m4 (file contents):
Revision 1.19 by sf-exg, Sun Mar 28 08:39:34 2010 UTC vs.
Revision 1.20 by sf-exg, Sun Jul 11 16:04:54 2010 UTC

229 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp) 229 AC_DEFINE_UNQUOTED(UTMP_FILE, "$pt_cv_path_utmp", Define location of utmp)
230fi 230fi
231 231
232dnl# -------------------------------------------------------------------------- 232dnl# --------------------------------------------------------------------------
233 233
234dnl# find utmpx - if a utmp file exists at the same location and is more than
235dnl# a day newer, then dump the utmpx. People leave lots of junk around.
236AC_CACHE_CHECK(where utmpx is located, pt_cv_path_utmpx,
237[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
238#include <stdlib.h>
239#include <sys/types.h>
240#include <utmpx.h>
241#include <errno.h>
242#include <sys/stat.h>
243#ifdef HAVE_STRING_H
244#include <string.h>
245#endif
246main()
247{
248 char **u, *p, *utmplist[] = {
249#ifdef UTMPX_FILE
250 UTMPX_FILE,
251#endif
252#ifdef _PATH_UTMPX
253 _PATH_UTMPX,
254#endif
255 "/var/adm/utmpx", "/etc/utmpx", NULL };
256 FILE *a, *f=fopen("conftestval", "w");
257 struct stat statu, statux;
258 if (!f) exit(1);
259 for (u = utmplist; *u; u++) {
260 if ((a = fopen(*u, "r")) != NULL || errno == EACCES) {
261 if (stat(*u, &statux) < 0)
262 continue;
263 p = strdup(*u);
264 p[strlen(p) - 1] = '\0';
265 if (stat(p, &statu) >= 0
266 && (statu.st_mtime - statux.st_mtime > 86400))
267 continue;
268 fprintf(f, "%s\n", *u);
269 exit(0);
270 }
271 }
272 exit(0);
273}]])],[pt_cv_path_utmpx=`cat conftestval`],[pt_cv_path_utmpx=],[dnl
274 AC_MSG_WARN(Define UTMPX_FILE in config.h manually)])])
275if test x$pt_cv_path_utmpx != x; then
276 AC_DEFINE_UNQUOTED(UTMPX_FILE, "$pt_cv_path_utmpx", Define location of utmpx)
277fi
278
279dnl# --------------------------------------------------------------------------
280
281dnl# find wtmp 234dnl# find wtmp
282AC_CACHE_CHECK(where wtmp is located, pt_cv_path_wtmp, 235AC_CACHE_CHECK(where wtmp is located, pt_cv_path_wtmp,
283[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h> 236[AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <stdio.h>
284#include <stdlib.h> 237#include <stdlib.h>
285#include <sys/types.h> 238#include <sys/types.h>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines