1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00
freebsd-ports/emulators/simh/files/patch-sim__ether.c
Matthew Seaman 7c084f620e Fixes to allow building on 12-CURRENT
- fix build failures in i386 and amd64 due to compiler changes
- fix numerous compilation warnings and logical errors that may trap
  in the future
- convert all distribution files from DOS format to ease future changes
- convert legacy patch file to new naming convention

PR:		214990
Submitted by:	bob@eager.cx (maintainer)
2017-01-03 14:00:47 +00:00

44 lines
1.6 KiB
C

--- sim_ether.c.orig 2016-12-01 22:43:43 UTC
+++ sim_ether.c
@@ -1333,7 +1333,7 @@ static void eth_get_nic_hw_addr(ETH_DEV*
for (i=0; patterns[i] && (0 == dev->have_host_nic_phy_addr); ++i) {
snprintf(command, sizeof(command)-1, "ifconfig %s | %s >NIC.hwaddr", devname, patterns[i]);
system(command);
- if (f = fopen("NIC.hwaddr", "r")) {
+ if ((f = fopen("NIC.hwaddr", "r"))) {
while (0 == dev->have_host_nic_phy_addr) {
if (fgets(command, sizeof(command)-1, f)) {
char *p1, *p2;
@@ -1519,7 +1519,7 @@ sim_debug(dev->dbit, dev->dptr, "Writer
pthread_mutex_lock (&dev->writer_lock);
while (dev->handle) {
pthread_cond_wait (&dev->writer_cond, &dev->writer_lock);
- while (request = dev->write_requests) {
+ while ((request = dev->write_requests)) {
/* Pull buffer off request list */
dev->write_requests = request->next;
pthread_mutex_unlock (&dev->writer_lock);
@@ -1827,11 +1827,11 @@ pthread_mutex_destroy (&dev->writer_lock
pthread_cond_destroy (&dev->writer_cond);
if (1) {
struct write_request *buffer;
- while (buffer = dev->write_buffers) {
+ while ((buffer = dev->write_buffers)) {
dev->write_buffers = buffer->next;
free(buffer);
}
- while (buffer = dev->write_requests) {
+ while ((buffer = dev->write_requests)) {
dev->write_requests = buffer->next;
free(buffer);
}
@@ -2084,7 +2084,7 @@ if (!dev) return SCPE_UNATT;
/* Get a buffer */
pthread_mutex_lock (&dev->writer_lock);
-if (request = dev->write_buffers)
+if ((request = dev->write_buffers))
dev->write_buffers = request->next;
pthread_mutex_unlock (&dev->writer_lock);
if (!request)