Chapter 317 Section 7
As in the previous section if you tie one side to an animal and one side to a
trough, it is prohibited as you might leave one side for a long time.
Chapter 318 Section 1
If you do a biblical prohibition purposely on Shabbos, you can never have
benefit from that melacha, however, others can have benefit right after Shabbos.
If you did the melacha accidentally, then you and others cannot have benefit
from it on Shabbos but right after Shabbos all could have benefit.
Chapter 318 Section 2
If you have to slaughter an animal for a sick person who is dying, others
could have benefit from it. However, if you cook for a sick person who is dying,
others cannot have benefit from the cooked food. The reason is because you might
come to add more some for yourself.