* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
static const char *libcfs_debug_subsystems[] = LIBCFS_DEBUG_SUBSYS_NAMES;
static const char *libcfs_debug_masks[] = LIBCFS_DEBUG_MASKS_NAMES;
-#ifdef __linux__
#define DAEMON_CTL_NAME "/proc/sys/lnet/daemon_file"
#define SUBSYS_DEBUG_CTL_NAME "/proc/sys/lnet/subsystem_debug"
return (rc == len ? 0 : 1);
}
-#else
-#error - Unknown sysctl convention.
-#endif
static int do_debug_mask(char *name, int enable)
{
int jt_dbg_mark_debug_buf(int argc, char **argv)
{
static char scratch[MAX_MARK_SIZE] = "";
- struct libcfs_ioctl_data data = { 0 };
+ struct libcfs_ioctl_data data;
char *text;
int rc;
+ memset(&data, 0, sizeof(data));
+
if (argc > 1) {
int count, max_size = sizeof(scratch) - 1;
data.ioc_inllen1 = strlen(text) + 1;
data.ioc_inlbuf1 = text;
- if (libcfs_ioctl_pack(&data, &buf, max) != 0) {
- fprintf(stderr, "libcfs_ioctl_pack failed.\n");
- return -1;
- }
- rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_MARK_DEBUG, buf);
- if (rc) {
- fprintf(stderr, "IOC_LIBCFS_MARK_DEBUG failed: %s\n",
- strerror(errno));
- return -1;
- }
- return 0;
+ if (libcfs_ioctl_pack(&data, &buf, max) != 0) {
+ fprintf(stderr, "libcfs_ioctl_pack failed.\n");
+ return -1;
+ }
+
+ rc = l_ioctl(LNET_DEV_ID, IOC_LIBCFS_MARK_DEBUG, buf);
+ if (rc) {
+ fprintf(stderr, "IOC_LIBCFS_MARK_DEBUG failed: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ return 0;
}
static struct mod_paths {