Changeset 228 for branches/samba-3.2.x/source/modules/gpfs.c
- Timestamp:
- May 26, 2009, 9:44:50 AM (17 years ago)
- File:
-
- 1 edited
-
branches/samba-3.2.x/source/modules/gpfs.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/modules/gpfs.c
r133 r228 25 25 #include "vfs_gpfs.h" 26 26 27 static void *libgpfs_handle = NULL;28 27 static bool gpfs_share_modes; 29 28 static bool gpfs_leases; … … 136 135 } 137 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 138 184 void init_gpfs(void) 139 185 { 140 if (libgpfs_handle != NULL) { 141 return; 142 } 143 144 libgpfs_handle = sys_dlopen("libgpfs_gpl.so", RTLD_LAZY); 145 146 if (libgpfs_handle == NULL) { 147 DEBUG(10, ("sys_dlopen for libgpfs_gpl failed: %s\n", 148 strerror(errno))); 149 return; 150 } 151 152 DEBUG(10, ("libgpfs_gpl.so loaded\n")); 153 154 gpfs_set_share_fn = sys_dlsym(libgpfs_handle, "gpfs_set_share"); 155 if (gpfs_set_share_fn == NULL) { 156 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol " 157 "'gpfs_set_share'\n")); 158 goto failed; 159 } 160 161 gpfs_set_lease_fn = sys_dlsym(libgpfs_handle, "gpfs_set_lease"); 162 if (gpfs_set_lease_fn == NULL) { 163 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol " 164 "'gpfs_set_lease'\n")); 165 sys_dlclose(libgpfs_handle); 166 167 goto failed; 168 } 169 170 gpfs_getacl_fn = sys_dlsym(libgpfs_handle, "gpfs_getacl"); 171 if (gpfs_getacl_fn == NULL) { 172 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol " 173 "'gpfs_getacl'\n")); 174 goto failed; 175 } 176 177 gpfs_putacl_fn = sys_dlsym(libgpfs_handle, "gpfs_putacl"); 178 if (gpfs_putacl_fn == NULL) { 179 DEBUG(3, ("libgpfs_gpl.so does not contain the symbol " 180 "'gpfs_putacl'\n")); 181 goto failed; 182 } 186 init_gpfs_function(&gpfs_set_share_fn, "gpfs_set_share"); 187 init_gpfs_function(&gpfs_set_lease_fn, "gpfs_set_lease"); 188 init_gpfs_function(&gpfs_getacl_fn, "gpfs_getacl"); 189 init_gpfs_function(&gpfs_putacl_fn, "gpfs_putacl"); 183 190 184 191 gpfs_share_modes = lp_parm_bool(-1, "gpfs", "sharemodes", True); … … 186 193 187 194 return; 188 189 failed:190 sys_dlclose(libgpfs_handle);191 /* leave libgpfs_handle != NULL around, no point192 in trying twice */193 gpfs_set_share_fn = NULL;194 gpfs_set_lease_fn = NULL;195 gpfs_getacl_fn = NULL;196 gpfs_putacl_fn = NULL;197 195 } 198 196
Note:
See TracChangeset
for help on using the changeset viewer.
