Skip to contentSkip to conversation

canbusload: flush output at the end of each cycle

can-utils Kurt Van Dijck 3 participants 11 messages Dec 21, 2011 – Jan 11, 2012 CAN network drivers

lore
Share & tools
lore
#0 lore raw

canbusload: flush output at the end of each cycle

When canbusload is piped to another program, the output is queued for several cycles. This patch will flush the output explicitely.

This patch is available in [email protected]:~kurt-vd/can-j1939-utils in branch regular.

canbusload.c +1 -0
index 26323d2..2693b9e 100644
@@ -201,6 +201,7 @@ void printstats(int signo)
 	}
 
 	printf("\n");
+	fflush(stdout);
 
 	alarm(1);
 }
#1 lore raw
Quoted 7 lines · Kurt Van Dijck

canbusload: flush output at the end of each cycle

When canbusload is piped to another program, the output is queued for several cycles. This patch will flush the output explicitely.

Tnx Kurt.

I'll put it into the can-utils tree the next days.

Regards,
Oliver

Quoted 20 lines

This patch is available in [email protected]:~kurt-vd/can-j1939-utils in branch regular.

canbusload.c +1 -1
index 26323d2..2693b9e 100644
@@ -201,6 +201,7 @@ void printstats(int signo)
 	}
 
 	printf("\n");
+	fflush(stdout);
 
 	alarm(1);
 }
--

To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 8 lines · Oliver Hartkopp
Quoted 6 lines · Kurt Van Dijck

canbusload: flush output at the end of each cycle

When canbusload is piped to another program, the output is queued for several cycles. This patch will flush the output explicitely.

Quoted 8 lines
Quoted 1 line

Tnx Kurt.

I'll put it into the can-utils tree the next days.

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#3 lore raw
Quoted 14 lines · Marc Kleine-Budde
Quoted 13 lines · Oliver Hartkopp
Quoted 7 lines · Kurt Van Dijck

canbusload: flush output at the end of each cycle

When canbusload is piped to another program, the output is queued for several cycles. This patch will flush the output explicitely.

Quoted 7 lines
Quoted 3 lines

Tnx Kurt.

I'll put it into the can-utils tree the next days.

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Yes. I noticed myself, that i need to improve this process by reading more git documentation ;-)

Yesterday i just cherry-picked the patch and pushed it to the repo.

The next time i'll do it the right(TM) way :-)

Regards,
Oliver

#4 lore raw

using git

Quoted 11 lines
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Yes. I noticed myself, that i need to improve this process by reading more git documentation ;-)

Yesterday i just cherry-picked the patch and pushed it to the repo.

The next time i'll do it the right(TM) way :-)

Oliver or Marc,

just out of curiosity,
what would be the right(TM) way?

regards,
Kurt

#5 lore raw

Re: using git

Quoted 8 lines · Kurt Van Dijck
Quoted 8 lines
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Yes. I noticed myself, that i need to improve this process by reading more git documentation ;-)

Quoted 8 lines
Quoted 3 lines

Yesterday i just cherry-picked the patch and pushed it to the repo.

The next time i'll do it the right(TM) way :-)

Oliver or Marc,

just out of curiosity,
what would be the right(TM) way?

3 possibilities:

1) merge your tree:
(if it only contains the patch we want)

git checkout master
git merge tree-of-kvd/branch-name
git push origin master

2) cherry pick

git checkout master
git cherry-pick -s commitish-of-patch # -s automatically adds the S-o-b git push origin master

3) apply patch

git checkout master
git am -s /path/to/patch # -s automatically adds the S-o-b
git push origin master

For solution 1 and 2 you need Kurt's tree in your local repo (git remote add).

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#6 lore raw

Re: using git

Quoted 33 lines · Marc Kleine-Budde
Quoted 8 lines · Kurt Van Dijck
Quoted 8 lines
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Yes. I noticed myself, that i need to improve this process by reading more git documentation ;-)

Quoted 8 lines
Quoted 3 lines

Yesterday i just cherry-picked the patch and pushed it to the repo.

The next time i'll do it the right(TM) way :-)

Oliver or Marc,

just out of curiosity,
what would be the right(TM) way?

3 possibilities:

1) merge your tree:
(if it only contains the patch we want)

git checkout master
git merge tree-of-kvd/branch-name
git push origin master

2) cherry pick

git checkout master
git cherry-pick -s commitish-of-patch # -s automatically adds the S-o-b git push origin master

Quoted 6 lines

3) apply patch

git checkout master
git am -s /path/to/patch # -s automatically adds the S-o-b
git push origin master

thanks for this lesson :-)
1 additional question:
Would in case 3 the SHA commit name be the same?

Thanks,
Kurt

Quoted 5 lines

For solution 1 and 2 you need Kurt's tree in your local repo (git remote add).

Marc

#7 lore raw

Re: using git

Quoted 36 lines · Kurt Van Dijck
Quoted 35 lines · Marc Kleine-Budde
Quoted 8 lines · Kurt Van Dijck
Quoted 8 lines
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Yes. I noticed myself, that i need to improve this process by reading more git documentation ;-)

Quoted 8 lines
Quoted 3 lines

Yesterday i just cherry-picked the patch and pushed it to the repo.

The next time i'll do it the right(TM) way :-)

Oliver or Marc,

just out of curiosity,
what would be the right(TM) way?

3 possibilities:

1) merge your tree:
(if it only contains the patch we want)

git checkout master
git merge tree-of-kvd/branch-name
git push origin master

2) cherry pick

git checkout master
git cherry-pick -s commitish-of-patch # -s automatically adds the S-o-b git push origin master

3) apply patch

Quoted 8 lines
Quoted 4 lines

git checkout master
git am -s /path/to/patch # -s automatically adds the S-o-b
git push origin master

thanks for this lesson :-)
1 additional question:
Would in case 3 the SHA commit name be the same?

Compared 2 and 3?

Usually not. As the meta data (here the timestamps) will be included in the calculation of the committish, it won't be the same. E.g. the meta data of your commit in master:

Author:     Kurt Van Dijck <[email protected]>
AuthorDate: Wed Dec 21 10:08:57 2011 +0100
Commit:     Oliver Hartkopp <[email protected]>
CommitDate: Tue Jan 10 17:41:07 2012 +0100

But you can tweak the timestamps, e.g. during "git commit --amend" with the environment variables GIT_AUTHOR_DATE, GIT_COMMITTER_DATE ("man git-commit").

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#8 lore raw

git question

In reply to Marc Kleine-Budde
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

in that regard, I was wondering if one could add the S-o-b way after the actual commit?

Kurt

#9 lore raw

Re: git question

Quoted 5 lines · Kurt Van Dijck
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

in that regard, I was wondering if one could add the S-o-b way after the actual commit?

Yes but no.

Yes, you can change the commit message (git commit --amend), but if you have already pushed it to the central repo on gitorious, you should not do it, as it changes the history.

Marc

Signature · 4 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
#10 lore raw

Re: git question

Quoted 4 lines · Marc Kleine-Budde
Quoted 3 lines · Kurt Van Dijck
Quoted 3 lines

nitpick:
Oliver, please don't forget to add your S-o-b if you are pushing commits to the tree.

Quoted 8 lines
Quoted 2 lines

in that regard, I was wondering if one could add the S-o-b way after the actual commit?

Yes but no.

Yes, you can change the commit message (git commit --amend), but if you have already pushed it to the central repo on gitorious, you should not do it, as it changes the history.

thanks for the answer.
Kurt