Changeset 4357be8 for zephyr.c


Ignore:
Timestamp:
Dec 26, 2003, 2:01:32 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
32eed98
Parents:
bf73bdd
Message:
Don't print an error about loading subs if there is no .zephyr.subs
Do the initial zephyr_buddy_check when pseduologin set to true.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    rbf73bdd r4357be8  
    33#include <sys/types.h>
    44#include <sys/wait.h>
     5#include <sys/stat.h>
    56#include <string.h>
    67#include "owl.h"
     
    7879  ZSubscription_t subs[3001];
    7980  int count, ret, i;
    80 
    81   ret=0;
    82  
     81  struct stat statbuff;
     82
    8383  if (filename==NULL) {
    8484    sprintf(subsfile, "%s/%s", owl_global_get_homedir(&g), ".zephyr.subs");
     
    8686    strcpy(subsfile, filename);
    8787  }
     88
     89  ret=stat(subsfile, &statbuff);
     90  if (ret) return(0);
     91
     92  ret=0;
    8893
    8994  ZResetAuthentication();
     
    124129  }
    125130
    126   /* sub with defaults */
    127   if (ZSubscribeTo(subs,count,0) != ZERR_NONE) {
     131  /* sub without defaults */
     132  if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) {
    128133    owl_function_error("Error subscribing to zephyr notifications.");
    129134    ret=-2;
     
    143148}
    144149
     150int owl_zephyr_loaddefaultsubs()
     151{
     152  ZSubscription_t subs[10];
     153   
     154  if (ZSubscribeTo(subs,0,0) != ZERR_NONE) {
     155    owl_function_error("Error subscribing to default zephyr notifications.");
     156    return(-1);
     157  }
     158  return(0);
     159}
     160
    145161int owl_zephyr_loadloginsubs(char *filename)
    146162{
     
    150166  char subsfile[1024], buffer[1024];
    151167  int count, ret, i;
    152 
    153   ret=0;
     168  struct stat statbuff;
    154169
    155170  if (filename==NULL) {
     
    158173    strcpy(subsfile, filename);
    159174  }
     175 
     176  ret=stat(subsfile, &statbuff);
     177  if (ret) return(0);
     178
     179  ret=0;
    160180
    161181  ZResetAuthentication();
Note: See TracChangeset for help on using the changeset viewer.