~ubuntu-branches/ubuntu/precise/xdm/precise

« back to all changes in this revision

Viewing changes to debian/patches/log_sourcing_better.diff

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2011-01-30 00:53:09 UTC
  • mfrom: (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20110130005309-30mjjyk7div7d494
Tags: 1:1.1.10-3ubuntu1
* Merge from debian unstable.  Remaining changes: (LP: #682196)
  - debian/{rules, xdm.install, local/ubuntu*}:
    + Add Ubuntu graphics and configure xdm to use them by default.
  - debian/patches/ubuntu_no_whiteglass.diff: Don't hardcode
    the default Xcursor theme to whiteglass. Use the Ubuntu
    default x-cursor-theme instead.
* debian/patches/ftbfs_binutils-gold.diff: Fix FTBFS with binutils-gold
  and ld --as-needed. (Closes: #556694)
* Dropped changes, no longer applicable:
  - debian/{xdm.postinst.in, xdm.postrm.in, xdm.preinst.in}

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# HG changeset patch
2
 
# User ejka@imfi.kspu.ru
3
 
# Node ID 28b3145223134d9d9a32202d0bae2036572e560a
4
 
# Parent  fbeb28a122da949d0e70dd30956800ae707700d3
5
 
Applied 078_xdm_log_sourcing_better.diff
6
 
 
7
 
--- xdm.orig/session.c
8
 
+++ xdm/session.c
9
 
@@ -794,7 +794,7 @@
10
 
                verify->userEnviron = setEnv(verify->userEnviron, "HOME", "/");
11
 
            }
12
 
        if (verify->argv) {
13
 
-               Debug ("executing session %s\n", verify->argv[0]);
14
 
+               LogInfo ("executing session %s\n", verify->argv[0]);
15
 
                execute (verify->argv, verify->userEnviron);
16
 
                LogError ("Session \"%s\" execution failed (err %d)\n", verify->argv[0], errno);
17
 
        } else {
18
 
@@ -824,21 +824,28 @@
19
 
 source (char **environ, char *file)
20
 
 {
21
 
     char       **args, *args_safe[2];
22
 
-    int                ret;
23
 
+    int                ret = 0;
24
 
+    FILE       *f;
25
 
 
26
 
     if (file && file[0]) {
27
 
-       Debug ("source %s\n", file);
28
 
-       args = parseArgs ((char **) 0, file);
29
 
-       if (!args) {
30
 
-           args = args_safe;
31
 
-           args[0] = file;
32
 
-           args[1] = NULL;
33
 
+       f = fopen (file, "r");
34
 
+       if (!f)
35
 
+           LogInfo ("not sourcing %s (%s)\n", file, _SysErrorMsg (errno));
36
 
+       else {
37
 
+           fclose (f);
38
 
+           LogInfo ("sourcing %s\n", file);
39
 
+           args = parseArgs ((char **) 0, file);
40
 
+           if (!args) {
41
 
+               args = args_safe;
42
 
+               args[0] = file;
43
 
+               args[1] = NULL;
44
 
+           }
45
 
+           ret = runAndWait (args, environ);
46
 
+           freeArgs (args);
47
 
        }
48
 
-       ret = runAndWait (args, environ);
49
 
-       freeArgs (args);
50
 
-       return ret;
51
 
-    }
52
 
-    return 0;
53
 
+    } else
54
 
+       Debug ("source() given null pointer in file argument\n");
55
 
+    return ret;
56
 
 }
57
 
 
58
 
 static int