~ubuntu-branches/ubuntu/raring/heimdal/raring

« back to all changes in this revision

Viewing changes to appl/telnet/telnetd/sys_term.c

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-07-21 17:40:58 UTC
  • mfrom: (1.1.12 upstream) (2.4.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20110721174058-byiuowgocek307cs
Tags: 1.5~pre2+git20110720-2
Fix dependency on pthreads when building on Linux 3.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
391
391
    {
392
392
        char *clone[] = { "/dev/ptc", "/dev/ptmx", "/dev/ptm",
393
393
                          "/dev/ptym/clone", 0 };
394
 
        
 
394
 
395
395
        char **q;
396
396
        int p;
397
397
        for(q=clone; *q; q++){
415
415
        int p;
416
416
        char *cp, *p1, *p2;
417
417
        int i;
418
 
        
 
418
 
419
419
#ifndef __hpux
420
420
        snprintf(line, sizeof(Xline), "/dev/ptyXX");
421
421
        p1 = &line[8];
425
425
        p1 = &line[13];
426
426
        p2 = &line[14];
427
427
#endif
428
 
        
429
 
        
 
428
 
 
429
 
430
430
        for (cp = "pqrstuvwxyzPQRST"; *cp; cp++) {
431
431
            struct stat stb;
432
 
        
 
432
 
433
433
            *p1 = *cp;
434
434
            *p2 = '0';
435
435
            /*
446
446
#if SunOS == 40
447
447
                    int dummy;
448
448
#endif
449
 
                
 
449
 
450
450
#ifndef __hpux
451
451
                    line[5] = 't';
452
452
#else
474
474
        extern lowpty, highpty;
475
475
        struct stat sb;
476
476
        int p;
477
 
        
 
477
 
478
478
        for (*ptynum = lowpty; *ptynum <= highpty; (*ptynum)++) {
479
479
            snprintf(myline, sizeof(myline), "/dev/pty/%03d", *ptynum);
480
480
            p = open(myline, 2);
856
856
 
857
857
#ifdef  STREAMSPTY
858
858
    ttyfd = t;
859
 
        
 
859
 
860
860
 
861
861
    /*
862
862
     * Not all systems have (or need) modules ttcompat and pckt so
876
876
               pushed (via autopush, for instance).
877
877
 
878
878
               */
879
 
        
 
879
 
880
880
            char *ttymodules[] = { "ttcompat", "ldterm", "ptem", NULL };
881
881
            char *ptymodules[] = { "pckt", NULL };
882
882
 
1289
1289
        struct utmpx utmpx;
1290
1290
        struct timeval tv;
1291
1291
        char *clean_tty;
1292
 
        
 
1292
 
1293
1293
        /*
1294
1294
         * Create utmp entry for child
1295
1295
         */
1296
 
        
 
1296
 
1297
1297
        clean_tty = clean_ttyname(line);
1298
1298
        memset(&utmpx, 0, sizeof(utmpx));
1299
1299
        strncpy(utmpx.ut_user,  ".telnet", sizeof(utmpx.ut_user));
1302
1302
        strncpy(utmpx.ut_id, make_id(clean_tty), sizeof(utmpx.ut_id));
1303
1303
#endif
1304
1304
        utmpx.ut_pid = pid;
1305
 
        
 
1305
 
1306
1306
        utmpx.ut_type = LOGIN_PROCESS;
1307
 
        
 
1307
 
1308
1308
        gettimeofday (&tv, NULL);
1309
1309
        utmpx.ut_tv.tv_sec = tv.tv_sec;
1310
1310
        utmpx.ut_tv.tv_usec = tv.tv_usec;
1315
1315
#endif
1316
1316
 
1317
1317
    scrub_env();
1318
 
        
 
1318
 
1319
1319
    /*
1320
1320
     * -h : pass on name of host.
1321
1321
     *          WARNING:  -h is accepted by login if and only if
1444
1444
#elif defined(__osf__) /* XXX */
1445
1445
        utxp->ut_exit.ut_termination = 0;
1446
1446
        utxp->ut_exit.ut_exit = 0;
1447
 
#else   
 
1447
#else
1448
1448
        utxp->ut_exit.e_termination = 0;
1449
1449
        utxp->ut_exit.e_exit = 0;
1450
1450
#endif