source: mate-xfce4-panel-plugin-loader-applet/trunk/fuentes/debian/patches/llx_last_pid.patch @ 4960

Last change on this file since 4960 was 4960, checked in by hectorgh, 2 years ago

adding patches

File size: 1.9 KB
  • src/mate-xfce4-panel-plugin-loader-applet.c

    Description: <short summary of the patch>
     TODO: Put a short summary on the line above and replace this paragraph
     with a longer explanation of this change. Complete the meta-information
     with other relevant fields (see below for details). To make it easier, the
     information below has been extracted from the changelog. Adjust it or drop
     it.
     .
     mate-xfce4-panel-plugin-loader-applet (1.1.1-1~webupd8~wily01) wily; urgency=medium
     .
       * initial debianization
    Author: Alin Andrei <webupd8@gmail.com>
    
    ---
    The information above should follow the Patch Tagging Guidelines, please
    checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
    are templates for supplementary fields that you might want to add:
    
    Origin: <vendor|upstream|other>, <url of original patch>
    Bug: <url in upstream bugtracker>
    Bug-Debian: https://bugs.debian.org/<bugnumber>
    Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
    Forwarded: <no|not-needed|url proving that it has been forwarded>
    Reviewed-By: <name and email of someone who approved the patch>
    Last-Update: <YYYY-MM-DD>
    
    old new static FILE *open_proc_environ(const cha 
    465465        closedir(dirp);
    466466        return NULL;
    467467}
     468
     469
     470static FILE *open_proc_environ_mate()
     471{
     472        char line[32];
     473        FILE *cmd = popen("pgrep -n mate-panel", "r");
     474        fgets(line, 32, cmd);
     475        pid_t pid = strtoul(line, NULL, 10);
     476        if (pid!=0)
     477        {
     478                char pth[32];
     479                snprintf(pth, sizeof pth, "/proc/%d/environ", pid);
     480                return fopen(pth,"rb");
     481        }
     482
     483        return NULL;
     484
     485       
     486
     487}
     488
    468489static void set_environmental_variables_from_mate_panel()
    469490{
    470         FILE *f = open_proc_environ("mate-panel");
     491        //FILE *f = open_proc_environ("mate-panel");
     492        FILE *f = open_proc_environ_mate();
    471493        if (f)
    472494        {
    473495                int env_buff_size = 0, env_buff_pos = 0;
Note: See TracBrowser for help on using the repository browser.