~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/misc/Delay.c,v 3.3 2000/12/08 20:13:38 eich Exp $ */
 
2
 
 
3
#include "X.h"
 
4
#include "xf86.h"
 
5
#include "xf86Priv.h"
 
6
#include "xf86_OSlib.h"
 
7
 
 
8
#include <time.h>
 
9
 
 
10
void
 
11
xf86UDelay(long usec)
 
12
{
 
13
#if 0
 
14
    struct timeval start, interrupt;
 
15
#else
 
16
    int sigio;
 
17
 
 
18
    sigio = xf86BlockSIGIO();
 
19
    xf86usleep(usec);
 
20
    xf86UnblockSIGIO(sigio);
 
21
#endif
 
22
 
 
23
#if 0
 
24
    gettimeofday(&start,NULL);
 
25
 
 
26
    do {
 
27
        usleep(usec);
 
28
        gettimeofday(&interrupt,NULL);
 
29
        
 
30
        if ((usec = usec - (interrupt.tv_sec - start.tv_sec) * 1000000
 
31
              - (interrupt.tv_usec - start.tv_usec)) < 0)
 
32
            break;
 
33
        start = interrupt;
 
34
    } while (1);
 
35
#endif
 
36
}
 
37