Displaying 20 results from an estimated 690 matches for "strncmp".
Did you mean:
strcmp
2016 Jul 17
0
[PATCH] Restore - chain.c32: Allow both "guid" and "uuid"
...diff --git a/com32/chain/chain.c b/com32/chain/chain.c
index 4e9e32d..492f21c 100644
--- a/com32/chain/chain.c
+++ b/com32/chain/chain.c
@@ -286,7 +286,8 @@ int find_dp(struct part_iter **_iter)
error("Unable to find requested MBR signature.");
goto bail;
}
- } else if (!strncmp(opt.drivename, "guid", 4)) {
+ } else if (!strncmp(opt.drivename, "guid", 4) ||
+ !strncmp(opt.drivename, "uuid", 4)) {
if (str_to_guid(opt.drivename + 5, &gpt_guid))
goto bail;
if (find_by_guid(&gpt_guid, &iter) < 0) {
diff --g...
2014 Jul 01
1
indexer failure: lucene: while doing doveadm commands
...was running I got:
Jul 1 00:30:00 thebighonker dovecot: indexer-worker(ler): Error: lucene: Failed to sync mailbox INBOX: Mailbox isn't selectable
Jul 1 00:30:00 thebighonker dovecot: indexer-worker(ler): Panic: file mailbox-list.c: line 1125 (mailbox_list_try_mkdir_root): assertion failed: (strncmp(root_dir, path, strlen(root_dir)) == 0)
Jul 1 00:30:00 thebighonker dovecot: indexer: Error: Indexer worker disconnected, discarding 1 requests for ler
Jul 1 00:30:00 thebighonker dovecot: indexer-worker(ler): Fatal: master: service(indexer-worker): child 20538 killed with signal 6 (core not dump...
2016 Jul 14
3
[PATCH] : Adding dlabel option to chain.c32
On 07/14/16 05:56, Ady Ady via Syslinux wrote:
>
> @Peter, Erwan, Gene, Michal, (and anyone else interested)...
>
> Although I haven't actually tested Erwan's patch, would it be
> acceptable by you (all) if I were to send a patch to this Syslinux
> Mailing List with the same code while changing the wording as I
> previously suggested in a prior email? Would it be
2006 Jun 29
3
Secure connection from "localhost" in jails
...COUNT &&
hash_size(clients) >= max_logging_users) {
@@ -429,8 +429,10 @@
client->common.tls = ssl;
addr = net_ip2addr(ip);
+ local_addr = net_ip2addr(local_ip);
client->common.secured = ssl ||
(IPADDR_IS_V4(ip) && strncmp(addr, "127.", 4) == 0) ||
+ (IPADDR_IS_V4(ip) && strncmp(addr, local_addr,
strlen(local_addr)) == 0) ||
(IPADDR_IS_V6(ip) && (strcmp(addr, "::1") == 0 ||
strncmp(addr, "::ffff:127.", 11...
2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...id)
{
char **r = NULL;
int size = 0, alloc = 0;
- DIR *dir;
- struct dirent *d;
- char buf[256];
-
- dir = opendir ("/sys/block");
- if (!dir) {
- reply_with_perror ("opendir: /sys/block");
- return NULL;
- }
- while ((d = readdir (dir)) != NULL) {
- if (strncmp (d->d_name, "sd", 2) == 0 ||
- strncmp (d->d_name, "hd", 2) == 0 ||
- strncmp (d->d_name, "vd", 2) == 0) {
- snprintf (buf, sizeof buf, "/dev/%s", d->d_name);
+ /* Add a device to the list of devices */
+ int add_to_device_list(const char *...
2008 Aug 07
1
string comparison
Hi,
I have a package where I do things like this a lot:
if(strncmp(CHAR(asChar(Scategory)), "chance", 6) == 0)
category = h_category_chance;
else if(strncmp(CHAR(asChar(Scategory)), "utility", 7) == 0)
category = h_category_utility;
else if(strncmp(CHAR(asChar(Scategory)), "decision", 8) == 0)
category = h_categor...
2013 Oct 25
1
Shutdown problem with Mecer 1000VA Online UPS
...9;, the driver
> interprets it as a failure..
Again looking at the code.
462 /*
463 * If a command is invalid, it will be echoed back.
464 * As an exception, Best UPS units will report "ACK" in case of success!
465 */
466 if (blazer_command(buf, buf, sizeof(buf)) > 0) {
467 if (strncmp(buf, "ACK", 3)) {
468 upslogx(LOG_ERR, "instcmd: command [%s] failed", cmdname);
469 return STAT_INSTCMD_FAILED;
470 }
471 }
472
473 upslogx(LOG_INFO, "instcmd: command [%s] handled", cmdname);
474 return STAT_INSTCMD_HANDLED;
It seems from the code that the tes...
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
The series below makes changes like these mechanically,
one class of change per change-set:
strcmp(...) == 0 to STREQ(...)
strcmp(...) != 0 to STRNEQ(...)
strncmp(...) == 0 to STREQLEN(...)
strncmp(...) != 0 to STRNEQLEN(...)
strcasecmp(...) == 0 to STRCASEEQ(...)
strcasecmp(...) != 0 to STRCASENEQ(...)
strncasecmp(...) == 0 to STRCASEEQLEN(...)
strncasecmp(...) != 0 to STRCASENEQLEN(...)
Then it enables the "make syntax-check...
2012 Nov 04
1
hexdump.c32 for Syslinux 5.00-pre9
...r, "argc or argv failure!\n");
+ goto err_prog_name;
+ }
+ prog_name = argv[0];
+
+ /* Process arguments */
+ filename = NULL;
+ for (i = 1; i < argc; ++i) {
+ if (!argv[i]) {
+ fprintf(stderr, "argc and argv mismatch!\n");
+ goto err_argv;
+ }
+
+ if (!strncmp(argv[i], "--page", sizeof "--page") ||
+ !strncmp(argv[i], "-p", sizeof "-p")) {
+ opt_page = 1;
+ continue;
+ }
+
+ if (!strncmp(argv[i], "--no-buffer", sizeof "--no-buffer")) {
+ opt_no_buffer = 1;
+ continue;
+ }
+
+...
2023 Jan 30
2
[PATCH libnbd v2 4/4] generator/states-connect-socket-activation.c: Set LISTEN_FDNAMES
...sa_name) == -1)
+ goto err;
+ string_vector_append (env, p);
+ }
- /* Append the current environment, but remove LISTEN_PID, LISTEN_FDS. */
+ /* Append the current environment, but remove the special
+ * environment variables.
+ */
for (i = 0; environ[i] != NULL; ++i) {
if (strncmp (environ[i], "LISTEN_PID=", strlen ("LISTEN_PID=")) != 0 &&
- strncmp (environ[i], "LISTEN_FDS=", strlen ("LISTEN_FDS=")) != 0) {
+ strncmp (environ[i], "LISTEN_FDS=", strlen ("LISTEN_FDS=")) != 0 &&
+...
2009 Aug 06
1
[PATCH] Fix errno check in readdir in devsparts.c
...= 0;
dir = opendir ("/sys/block");
@@ -49,8 +48,11 @@ foreach_block_device (block_dev_func_t func)
return NULL;
}
- errno = 0;
- while ((d = readdir (dir)) != NULL) {
+ while(1) {
+ errno = 0;
+ struct dirent *d = readdir(dir);
+ if(NULL == d) break;
+
if (strncmp (d->d_name, "sd", 2) == 0 ||
strncmp (d->d_name, "hd", 2) == 0 ||
strncmp (d->d_name, "vd", 2) == 0 ||
--
1.6.2.5
2013 Oct 24
0
Shutdown problem with Mecer 1000VA Online UPS
...r first tries to stop pending shutdowns and you get
the 'operation not permitted' error, the driver interprets it as a
success.
When it tries to shutdown.return and you get '(ACK', the driver
interprets it as a failure..
You could try and change line 467 of blazer.c from this:
if (strncmp(buf, "ACK", 3)) {
to this:
if (strncmp(buf, "(ACK", 4)) {
..this should do the trick.
However, your UPS seems to speak an idiom that's more akin to the one
covered by the voltronic drivers (i.e. the (ACK/(NAK replies) -
available in the github repo - so maybe they're...
2008 Apr 10
1
Xen tools build error on c/s 17427
...refs -Werror
-fno-stack-protector -fno-builtin -msoft-float -I../../../tools/include
-I. -c -o hvmloader.o hvmloader.c
cc1: warnings being treated as errors
hvmloader.c: In function ''scan_etherboot_nic'':
hvmloader.c:363: warning: pointer targets in passing argument 1 of
''strncmp'' differ in signedness
hvmloader.c:378: warning: pointer targets in passing argument 1 of
''strncmp'' differ in signedness
hvmloader.c:396: warning: pointer targets in passing argument 1 of
''strncmp'' differ in signedness
make[5]: *** [hvmloader.o] Error 1
m...
2016 Jul 15
0
[PATCH] : Add diskbypartname option to chain.c32
...e;
+}
+
static void do_boot(struct data_area *data, int ndata)
{
struct syslinux_memmap *mmap;
@@ -300,6 +332,15 @@
}
if (find_by_label(opt.drivename + 6, &iter) < 0) {
error("Unable to find requested GPT partition by label.");
+ goto bail;
+ }
+ } else if (!strncmp(opt.drivename, "diskbypartname", 14)) {
+ if (!opt.drivename[15]) {
+ error("No partition name specified.");
+ goto bail;
+ }
+ if (find_disk_by_partition_name(opt.drivename + 15, &iter) < 0) {
+ error("Unable to find requested GPT partition by name."...
2017 Feb 12
2
Bug with zlib version checking for zlib >= 1.2.10, R version 3.3.2
...e fails when using a zlib version ? 1.5.10. I suggest
something like the following patch:
--- a/m4/R.m4
+++ b/m4/R.m4
@@ -3116,7 +3116,7 @@ int main() {
#ifdef ZLIB_VERSION
/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
version on the master site zlib.net */
- exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
+ exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0 && (strlen(ZLIB_VERSION) < 6 || strncmp(ZLIB_VERSION, "1.2.10", 6) < 0));
#else
exit(1);
#endif
This could of course be improved to properly parse the string.
Cheer...
2023 Jan 28
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...;
+ if (p == NULL)
goto err;
- }
+ string_vector_append (env, p);
- /* Append the current environment, but remove LISTEN_PID, LISTEN_FDS. */
+ /* Append the current environment, but remove the special
+ * environment variables.
+ */
for (i = 0; environ[i] != NULL; ++i) {
- if (strncmp (environ[i], "LISTEN_PID=", PREFIX_LENGTH) != 0 &&
- strncmp (environ[i], "LISTEN_FDS=", PREFIX_LENGTH) != 0) {
+ if (strncmp (environ[i], "LISTEN_PID=", 11) != 0 &&
+ strncmp (environ[i], "LISTEN_FDS=", 11) != 0 &&
+...
2013 Oct 24
2
Shutdown problem with Mecer 1000VA Online UPS
Hi,
There seems to be a problem turning of the inverter on a Mecer online 1000VA
UPS.
OS: Debian Wheezy
Nut: Installed via apt - version 2.6.4-2.3
Debug output from driver.
root at proxmox1:~# /lib/nut/blazer_usb -DDDDD -a mecer -k
Network UPS Tools - Megatec/Q1 protocol USB driver 0.08 (2.6.4)
0.000000 send_to_all: SETINFO driver.parameter.port "auto"
0.000023
2011 Apr 01
1
[GIT PULL] elflink ldlinux
The following changes since commit 8c576f1fe03e34879921311f46613a35c6530000:
Merge remote-tracking branch 'mfleming/for-hpa/elflink/fix-compiler-warnings' into elflink (2011-03-16 12:53:58 -0700)
are available in the git repository at:
git://git.zytor.com/users/mfleming/syslinux.git for-hpa/elflink/ldlinux
Matt Fleming (1):
ldlinux: Perform auto-boot if NOESCAPE set in config
2017 May 26
2
[RFC PATCH v3 5/5] ACPI: button: Always notify kernel space using _LID returning value
...on.
+ */
+ if (!bios_notify &&
+ lid_init_state != ACPI_BUTTON_LID_INIT_METHOD)
+ state = acpi_lid_evaluate_state(device);
+ }
acpi_lid_notifier_call(device, state);
}
@@ -572,10 +584,10 @@ static int param_set_lid_init_state(const char *val, struct kernel_param *kp)
if (!strncmp(val, "open", sizeof("open") - 1)) {
lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;
- pr_info("Notify initial lid state as open\n");
+ pr_info("Notify initial lid state to users space as open and kernel drivers with _LID return value\n");
} else if (!strnc...
2023 Feb 27
2
report BUG: io_uring triggers umount error
...cp output shows it misses a fput.
>>>
>>> #include <linux/mount.h>
>>> #include <linux/string.h>
>>>
>>> kprobe:mntget
>>> {
>>> $n = ((struct vfsmount *)arg0)->mnt_sb->s_type->name;
>>>
>>> if (!strncmp(str($n), "ocfs2", 5)) {
>>> @[comm] += 1;
>>>
>>> printf("%s", kstack);
>>> }
>>> }
>>>
>>> kprobe:mntput
>>> {
>>> $n = ((struct vfsmount *)arg0)->mnt_sb->s_type->name;
>>>...