FreeBSD Bugzilla – Attachment 179369 Details for
Bug 216466
Incorrect rc.d startup script for multimedia/motion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix motion.conf location & add netcam only support
motion-4.0.1_2.diff (text/plain), 4.64 KB, created by
Jason E. Hale
on 2017-01-28 11:47:50 UTC
(
hide
)
Description:
Fix motion.conf location & add netcam only support
Filename:
MIME Type:
Creator:
Jason E. Hale
Created:
2017-01-28 11:47:50 UTC
Size:
4.64 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 432612) >+++ Makefile (working copy) >@@ -3,7 +3,7 @@ > > PORTNAME= motion > PORTVERSION= 4.0.1 >-PORTREVISION= 1 >+PORTREVISION= 2 > DISTVERSIONPREFIX= release- > CATEGORIES= multimedia > >@@ -31,7 +31,7 @@ > > PLIST_FILES= bin/motion \ > man/man1/motion.1.gz \ >- "@sample etc/motion.conf.sample" >+ "@sample ${ETCDIR}/motion.conf.sample" > PORTDOCS= CHANGELOG CREDITS README.md README.FreeBSD \ > motion_guide.html > PORTEXAMPLES= camera1-dist.conf camera2-dist.conf \ >@@ -38,10 +38,10 @@ > camera3-dist.conf camera4-dist.conf > > OPTIONS_DEFINE= DOCS EXAMPLES FFMPEG MYSQL PGSQL SQLITE3 >-OPTIONS_SINGLE= VIDEO >-OPTIONS_SINGLE_VIDEO= BKTR PWCBSD >+OPTIONS_RADIO= VIDEO >+OPTIONS_RADIO_VIDEO= BKTR PWCBSD > OPTIONS_DEFAULT= BKTR FFMPEG >-VIDEO_DESC= Video capture driver >+VIDEO_DESC= Video capture driver (Netcam support only if none selected) > > BKTR_DESC= BKTR based TV capture cards > BKTR_CONFIGURE_WITH= bktr >@@ -87,8 +87,9 @@ > do-install: > ${INSTALL_PROGRAM} ${WRKSRC}/motion ${STAGEDIR}${PREFIX}/bin > ${INSTALL_MAN} ${WRKSRC}/motion.1 ${STAGEDIR}${MANPREFIX}/man/man1 >+ @${MKDIR} ${STAGEDIR}${PREFIX}/etc/motion > ${INSTALL_DATA} ${WRKSRC}/motion-dist.conf \ >- ${STAGEDIR}${PREFIX}/etc/motion.conf.sample >+ ${STAGEDIR}${ETCDIR}/motion.conf.sample > > do-install-DOCS-on: > @${MKDIR} ${STAGEDIR}${DOCSDIR} >Index: files/motion.in >=================================================================== >--- files/motion.in (revision 432612) >+++ files/motion.in (working copy) >@@ -21,6 +21,6 @@ > > command=%%PREFIX%%/bin/${name} > pidfile="/var/run/${name}.pid" >-required_files=%%PREFIX%%/etc/${name}.conf >+required_files=%%ETCDIR%%/${name}.conf > > run_rc_command "$1" >Index: files/patch-configure.ac >=================================================================== >--- files/patch-configure.ac (revision 432612) >+++ files/patch-configure.ac (working copy) >@@ -5,7 +5,7 @@ > AC_MSG_CHECKING(for V42L support) > AC_MSG_RESULT(skipping) > -else >-+elif test "${BKTR}" = "no"; then >++elif test "${PWCBSD}" = "yes"; then > AC_CHECK_TYPE([struct v4l2_buffer], > [SUPPORTED_V4L2=true], > [SUPPORTED_V4L2=false], >Index: files/patch-netcam.c >=================================================================== >--- files/patch-netcam.c (revision 432612) >+++ files/patch-netcam.c (working copy) >@@ -1,13 +1,57 @@ >-Fix sockaddr type mismatch warnings (Fixed upstream in dbd7282) >+Fix netcam getaddrinfo/connect usage (Fixed upstream in be2328a) > > --- netcam.c.orig 2016-10-25 01:39:24 UTC > +++ netcam.c >-@@ -948,7 +948,7 @@ static int netcam_connect(netcam_context >+@@ -840,8 +840,7 @@ static void netcam_disconnect(netcam_con >+ */ >+ static int netcam_connect(netcam_context_ptr netcam, int err_flag) >+ { >+- struct sockaddr_in6 server; /* For connect */ >+- struct addrinfo *ai; /* For getaddrinfo */ >++ struct addrinfo *ai; >+ int ret; >+ int saveflags; >+ int back_err; >+@@ -851,8 +850,11 @@ static int netcam_connect(netcam_context >+ fd_set fd_w; >+ struct timeval selecttime; >+ >++ char port[15]; >++ sprintf(port,"%u",netcam->connect_port); >++ >+ /* Lookup the hostname given in the netcam URL. */ >+- if ((ret = getaddrinfo(netcam->connect_host, NULL, NULL, &ai)) != 0) { >++ if ((ret = getaddrinfo(netcam->connect_host, port, NULL, &ai)) != 0) { >+ if (!err_flag) >+ MOTION_LOG(ERR, TYPE_NETCAM, NO_ERRNO, "%s: getaddrinfo() failed (%s): %s", >+ netcam->connect_host, gai_strerror(ret)); >+@@ -920,16 +922,6 @@ static int netcam_connect(netcam_context >+ netcam->sock); >+ >+ /* >+- * Fill the hostname details into the 'server' structure and >+- * attempt to connect to the remote server. >+- */ >+- memset(&server, 0, sizeof(server)); >+- memcpy(&server, ai->ai_addr, sizeof(server)); >+- server.sin6_family = ai->ai_family; >+- server.sin6_port = htons(netcam->connect_port); >+- freeaddrinfo(ai); >+- >+- /* >+ * We set the socket non-blocking and then use a 'select' >+ * system call to control the timeout. >+ */ >+@@ -948,9 +940,11 @@ static int netcam_connect(netcam_context > } > > /* Now the connect call will return immediately. */ > - ret = connect(netcam->sock, &server, sizeof(server)); >-+ ret = connect(netcam->sock, (struct sockaddr *)&server, sizeof(server)); >++ ret = connect(netcam->sock, ai->ai_addr, ai->ai_addrlen); > back_err = errno; /* Save the errno from connect */ > >++ freeaddrinfo(ai); >++ > /* If the connect failed with anything except EINPROGRESS, error. */ >+ if ((ret < 0) && (back_err != EINPROGRESS)) { >+ if (!err_flag)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216466
:
179349
| 179369