~siretart/nxproxy/nxproxy-FAU-trunk

« back to all changes in this revision

Viewing changes to debian/patches/stdin

  • Committer: Reinhard Tartler
  • Author(s): Matthew Johnson
  • Date: 2011-01-25 19:54:37 UTC
  • Revision ID: git-v1:687f5144365c0018e3a8ac4b2ca1b39ef0528f4a
Imported Debian patch 3.2.0-1-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- Main.c.old  2007-07-18 17:39:13.000000000 +0200
 
2
+++ Main.c      2008-03-12 04:40:30.000000000 +0100
 
3
@@ -36,28 +36,48 @@
 
4
   int result = -1;
 
5
 
 
6
   char *options = NULL;
 
7
-
 
8
+  
 
9
+  char *nx_commfd_str = NULL;
 
10
+  
 
11
   options = getenv("NX_DISPLAY");
 
12
-
 
13
-  if (NXTransParseCommandLine(argc, argv) < 0)
 
14
+  
 
15
+  if ((nx_commfd_str = getenv("NX_COMMFD")) != NULL)
 
16
   {
 
17
-    NXTransCleanup();
 
18
-  }
 
19
+       int nx_commfd = atoi(nx_commfd_str);
 
20
 
 
21
-  if (NXTransParseEnvironment(options, 0) < 0)
 
22
-  {
 
23
-    NXTransCleanup();
 
24
+       if (result)
 
25
+               result = NXTransCreate(nx_commfd, NX_MODE_SERVER, options);
 
26
 
27
+       // go into endless loop
 
28
+
 
29
+       if (result)
 
30
+       {
 
31
+               while (NXTransRunning(NX_FD_ANY))
 
32
+                       result = NXTransContinue(NULL);
 
33
+       }
 
34
   }
 
35
+  else
 
36
+  {
 
37
+    if (NXTransParseCommandLine(argc, argv) < 0)
 
38
+    {
 
39
+      NXTransCleanup();
 
40
+    }
 
41
+
 
42
+    if (NXTransParseEnvironment(options, 0) < 0)
 
43
+    {
 
44
+      NXTransCleanup();
 
45
+    }
 
46
+
 
47
+   /*
 
48
+    * This should not return...
 
49
+    */
 
50
+
 
51
+    #ifdef TEST
 
52
+    fprintf(stderr, "Main: Yielding control to NX entry point.\n");
 
53
+    #endif
 
54
 
 
55
-  /*
 
56
-   * This should not return...
 
57
-   */
 
58
-
 
59
-  #ifdef TEST
 
60
-  fprintf(stderr, "Main: Yielding control to NX entry point.\n");
 
61
-  #endif
 
62
-
 
63
-  result = NXTransProxy(NX_FD_ANY, NX_MODE_ANY, NX_DISPLAY_ANY);
 
64
+    result = NXTransProxy(NX_FD_ANY, NX_MODE_ANY, NX_DISPLAY_ANY);
 
65
+  }
 
66
 
 
67
   /*
 
68
    * ...So these should not be called.