~ubuntu-branches/ubuntu/hardy/libgc/hardy-updates

« back to all changes in this revision

Viewing changes to if_not_there.c

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Murray
  • Date: 2005-02-03 00:50:53 UTC
  • mto: (3.1.1 etch) (1.2.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050203005053-9c0v9r2qcm2g1cfp
Tags: upstream-6.4
ImportĀ upstreamĀ versionĀ 6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# include <stdio.h>
5
5
# include <stdlib.h>
6
6
# include <unistd.h>
 
7
#ifdef __DJGPP__
 
8
#include <dirent.h>
 
9
#endif /* __DJGPP__ */
7
10
 
8
11
int main(argc, argv, envp)
9
12
int argc;
11
14
char ** envp;
12
15
{
13
16
    FILE * f;
 
17
#ifdef __DJGPP__
 
18
    DIR * d;
 
19
#endif /* __DJGPP__ */
14
20
    if (argc < 3) goto Usage;
15
21
    if ((f = fopen(argv[1], "rb")) != 0
16
22
        || (f = fopen(argv[1], "r")) != 0) {
17
23
        fclose(f);
18
24
        return(0);
19
25
    }
 
26
#ifdef __DJGPP__
 
27
    if ((d = opendir(argv[1])) != 0) {
 
28
            closedir(d);
 
29
            return(0);
 
30
    }
 
31
#endif
20
32
    printf("^^^^Starting command^^^^\n");
21
33
    fflush(stdout);
22
34
    execvp(argv[2], argv+2);