svn commit: samba r4423 - in branches/SAMBA_4_0/source: ntvfs/posix
param
metze at samba.org
metze at samba.org
Fri Dec 31 01:03:57 GMT 2004
Author: metze
Date: 2004-12-31 01:03:57 +0000 (Fri, 31 Dec 2004)
New Revision: 4423
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4423
Log:
give lp_parm_int() and lp_parm_ulong() default values
metze
Modified:
branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c
branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
branches/SAMBA_4_0/source/param/loadparm.c
Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c 2004-12-31 01:02:22 UTC (rev 4422)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_shortname.c 2004-12-31 01:03:57 UTC (rev 4423)
@@ -604,7 +604,7 @@
memset(ctx->prefix_cache, 0, sizeof(char *)*MANGLE_CACHE_SIZE);
memset(ctx->prefix_cache_hashes, 0, sizeof(uint32_t)*MANGLE_CACHE_SIZE);
- ctx->mangle_prefix = lp_parm_int(-1, "mangle", "prefix");
+ ctx->mangle_prefix = lp_parm_int(-1, "mangle", "prefix", -1);
if (ctx->mangle_prefix < 0 || ctx->mangle_prefix > 6) {
ctx->mangle_prefix = DEFAULT_MANGLE_PREFIX;
}
Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2004-12-31 01:02:22 UTC (rev 4422)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c 2004-12-31 01:03:57 UTC (rev 4423)
@@ -34,7 +34,6 @@
static void pvfs_setup_options(struct pvfs_state *pvfs)
{
int snum = pvfs->tcon->service;
- int delay;
const char *eadb;
if (lp_map_hidden(snum)) pvfs->flags |= PVFS_FLAG_MAP_HIDDEN;
@@ -53,11 +52,7 @@
if (lp_parm_bool(snum, "posix", "xattr", True)) pvfs->flags |= PVFS_FLAG_XATTR_ENABLE;
#endif
- pvfs->sharing_violation_delay = 1000000;
- delay = lp_parm_int(snum, "posix", "sharedelay");
- if (delay != -1) {
- pvfs->sharing_violation_delay = delay;
- }
+ pvfs->sharing_violation_delay = lp_parm_int(snum, "posix", "sharedelay", 1000000);
pvfs->share_name = talloc_strdup(pvfs, lp_servicename(snum));
@@ -81,7 +76,6 @@
}
}
-
if (pvfs->flags & PVFS_FLAG_XATTR_ENABLE) {
pvfs->fs_attribs |= FS_ATTR_NAMED_STREAMS;
}
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_4_0/source/param/loadparm.c 2004-12-31 01:02:22 UTC (rev 4422)
+++ branches/SAMBA_4_0/source/param/loadparm.c 2004-12-31 01:03:57 UTC (rev 4423)
@@ -1436,27 +1436,27 @@
/* Return parametric option from a given service. Type is a part of option before ':' */
/* Parametric option has following syntax: 'Type: option = value' */
-int lp_parm_int(int lookup_service, const char *type, const char *option)
+int lp_parm_int(int lookup_service, const char *type, const char *option, int default_v)
{
const char *value = get_parametrics(lookup_service, type, option);
if (value)
return lp_int(value);
- return (-1);
+ return default_v;
}
/* Return parametric option from a given service. Type is a part of option before ':' */
/* Parametric option has following syntax: 'Type: option = value' */
-unsigned long lp_parm_ulong(int lookup_service, const char *type, const char *option)
+unsigned long lp_parm_ulong(int lookup_service, const char *type, const char *option, unsigned long default_v)
{
const char *value = get_parametrics(lookup_service, type, option);
if (value)
return lp_ulong(value);
- return (0);
+ return default_v;
}
/* Return parametric option from a given service. Type is a part of option before ':' */
More information about the samba-cvs
mailing list