~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to src/display-manager.c

  • Committer: Robert Ancell
  • Author(s): Fneufneu
  • Date: 2011-06-02 07:38:13 UTC
  • Revision ID: robert.ancell@canonical.com-20110602073813-ulupm9tkytqo0l0c
Allow to compile on systems that don't have /dev/console (e.g. BSD)

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <fcntl.h>
21
21
#include <glib/gstdio.h>
22
22
#include <sys/ioctl.h>
 
23
#ifdef __linux__
23
24
#include <linux/vt.h>
 
25
#endif
24
26
 
25
27
#include "display-manager.h"
26
28
#include "xdmcp-server.h"
256
258
{
257
259
    gchar *vt;
258
260
    gboolean use_active = FALSE;
 
261
#ifdef __linux__
259
262
    gint console_fd;
 
263
#endif
260
264
    int number = -1;
261
265
 
262
266
    if (manager->priv->test_mode)
275
279
            return number;
276
280
    }
277
281
 
 
282
#ifdef __linux__
278
283
    console_fd = g_open ("/dev/console", O_RDONLY | O_NOCTTY);
279
284
    if (console_fd < 0)
280
285
    {
297
302
    }
298
303
 
299
304
    close (console_fd);
 
305
#else
 
306
    number = -1;
 
307
#endif    
300
308
 
301
309
    return number;  
302
310
}