Skip to contentSkip to conversation

5.0.0_beta1: glibc 2.4.0 quirk

PATCH In review Denys Vlasenko 2 participants 2 messages Sep 26, 2007 Kernel automounter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 5.0.0_beta1: glibc 2.4.0 quirk

hi Ian,

I have glibc 2.4.0 installed, and it expands pthread_cleanup_pop(1) into:

	} while (0); __pthread_unregister_cancel (&__cancel_buf); if (1) __cancel_routine (__cancel_arg); } while (0);

This doesn't compile if you have a label before it. gcc 4.2.1 says "error: label at end of compound statement".

This patch works around it by adding extra semicolon. --
vda

daemon/direct.c +8 -2
diff -d -urpN autofs-5.0.0_beta1-PATH/daemon/direct.c autofs-5.0.0_beta1-quirk/daemon/direct.c
@@ -967,7 +967,10 @@ int handle_packet_expire_direct(struct a
 
 	pthread_cleanup_pop(1);
 done:
-	pthread_cleanup_pop(1);
+	/* glibc 2.4.0 expands it into: */
+	/* } while (0); __pthread_unregister_cancel (&__cancel_buf); if (1) __cancel_routine (__cancel_arg); } while (0); */
+	/* ...and gcc 4.2.1 says "error: label at end of compound statement" */
+	; pthread_cleanup_pop(1);
 	return status;
 }
 
@@ -1258,7 +1261,10 @@ int handle_packet_missing_direct(struct 
 
 	pthread_cleanup_pop(1);
 done:
-	pthread_cleanup_pop(1);
+	/* glibc 2.4.0 expands it into: */
+	/* } while (0); __pthread_unregister_cancel (&__cancel_buf); if (1) __cancel_routine (__cancel_arg); } while (0); */
+	/* ...and gcc 4.2.1 says "error: label at end of compound statement" */
+	; pthread_cleanup_pop(1);
 	return status;
 }
 

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

maintainer
#1 lore raw
Quoted 10 lines · Denys Vlasenko

hi Ian,

I have glibc 2.4.0 installed, and it expands pthread_cleanup_pop(1) into:

	} while (0); __pthread_unregister_cancel (&__cancel_buf); if (1) __cancel_routine (__cancel_arg); } while (0);

This doesn't compile if you have a label before it. gcc 4.2.1 says "error: label at end of compound statement".

This patch works around it by adding extra semicolon.

Cool, I'll test this out and commit it.
Thanks