Changeset da4a6eb2a1588a437c77eee59f27a181876f0eeb

Show
Ignore:
Timestamp:
12/27/10 15:34:35 (2 years ago)
Author:
Nedko Arnaudov <nedko@…>
Children:
eeaa82d17170e394c90099b17ec0f2b4a2998734
Parents:
3a5b7037d88ca19b2003cba39fa7a4ed2bbfae0c
git-committer:
Nedko Arnaudov <nedko@arnaudov.name> / 2010-12-27T15:34:35Z+0200
Message:

ladishd: save hidden porst of stopped apps.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • daemon/save.c

    r9868de4 rda4a6eb  
    4646} 
    4747 
    48 static bool is_app_running(ladish_app_supervisor_handle app_supervisor, ladish_port_handle port) 
     48static bool is_hidden_port_interesting(ladish_app_supervisor_handle app_supervisor, ladish_client_handle client, ladish_port_handle port) 
    4949{ 
    5050  uuid_t app_uuid; 
    5151  ladish_app_handle app; 
    5252 
     53  if (is_system_client(client) || ladish_port_is_link(port)) 
     54  { 
     55    return true; 
     56  } 
     57 
     58  /* hidden ports of external apps should not be saved */ 
     59  /* hidden ports of stopped managed apps should be saved */ 
     60  /* hidden ports of started managed apps should not be saved */ 
     61 
    5362  if (!ladish_port_get_app(port, app_uuid)) 
    5463  { 
     64    /* port of external app, don't save */ 
    5565    return false; 
    5666  } 
     
    5969  if (app == NULL) 
    6070  { 
    61     return false; 
    62   } 
    63  
    64   return ladish_app_is_running(app); 
    65 } 
    66  
    67 #define is_port_interesting(app_supervisor, client, port) ( \ 
    68     is_app_running(app_supervisor, port) ||                 \ 
    69     ladish_port_is_link(port) ||                            \ 
    70     is_system_client(client)) 
     71    ASSERT_NO_PASS;             /* this should not happen because app ports are removed before app is removed */ 
     72    return false; 
     73  } 
     74 
     75  return !ladish_app_is_running(app); 
     76} 
    7177 
    7278bool ladish_write_string(int fd, const char * string) 
     
    489495 
    490496  /* skip hidden ports of running apps */ 
    491   if (hidden && !is_port_interesting(ctx_ptr->app_supervisor, client_handle, port_handle)) 
     497  if (hidden && !is_hidden_port_interesting(ctx_ptr->app_supervisor, client_handle, port_handle)) 
    492498  { 
    493499    return true; 
     
    604610 
    605611  if (hidden && 
    606       (!is_port_interesting(ctx_ptr->app_supervisor, client1, port1) || 
    607        !is_port_interesting(ctx_ptr->app_supervisor, client2, port2))) 
     612      (!is_hidden_port_interesting(ctx_ptr->app_supervisor, client1, port1) || 
     613       !is_hidden_port_interesting(ctx_ptr->app_supervisor, client2, port2))) 
    608614  { 
    609615    return true; 
     
    10021008 
    10031009  /* skip hidden ports of running apps */ 
    1004   if (hidden && !is_port_interesting(ctx_ptr->app_supervisor, client_handle, port_handle)) 
     1010  if (hidden && !is_hidden_port_interesting(ctx_ptr->app_supervisor, client_handle, port_handle)) 
    10051011  { 
    10061012    return true;